home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d16 / powerbat.arc / POWERBAT.DOC < prev    next >
Text File  |  1990-09-18  |  123KB  |  2,566 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                                         PowerBatch
  23.                                        Version 1.4
  24.  
  25.  
  26.  
  27.                               COMPUTING SYSTEMS DESIGN, INC.
  28.                                      P.O. Box 566484
  29.                                Atlanta, Georgia 30356-6009
  30.  
  31.  
  32.                                    _______
  33.                               ____|__     |               (tm)
  34.                            --|       |    |-------------------
  35.                              |   ____|__  |  Association of
  36.                              |  |       |_|  Shareware
  37.                              |__|   o   |    Professionals
  38.                            -----|   |   |---------------------
  39.                                 |___|___|    MEMBER
  40.  
  41.  
  42.             CSD,   Inc.  is   a  member   of  The  Association   of  Shareware
  43.             Professionals and subscribes  to all the policies and standards of
  44.             this organization.
  45.  
  46.                            Copyright (c) 1989,1990 by CSD, Inc.
  47.                               All Rights Reserved Worldwide
  48.  
  49.                   This documentation was produced on September 19, 1990
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.                                     Table Of Contents
  58.  
  59.  
  60.            Introduction . . . . . . . . . . . . . . . . . . . . . . . . .    1
  61.  
  62.            Registration Fees And What You Get . . . . . . . . . . . . . .    3
  63.  
  64.            Software Support . . . . . . . . . . . . . . . . . . . . . . .    4
  65.  
  66.            Concept Of Operation . . . . . . . . . . . . . . . . . . . . .    5
  67.  
  68.            Installation . . . . . . . . . . . . . . . . . . . . . . . . .    7
  69.  
  70.            Constructing A PowerBatch Source File  . . . . . . . . . . . .    9
  71.  
  72.            PowerBatch Commands  . . . . . . . . . . . . . . . . . . . . .   10
  73.  
  74.            Command Summary  . . . . . . . . . . . . . . . . . . . . . . .   30
  75.  
  76.            Compilation Errors . . . . . . . . . . . . . . . . . . . . . .   32
  77.  
  78.            Removing PowerBatch From Your System . . . . . . . . . . . . .   34
  79.  
  80.            Examples . . . . . . . . . . . . . . . . . . . . . . . . . . .   35
  81.               DEMO1 . . . . . . . . . . . . . . . . . . . . . . . . . . .   35
  82.               MOVE1 . . . . . . . . . . . . . . . . . . . . . . . . . . .   41
  83.               MOVE2 . . . . . . . . . . . . . . . . . . . . . . . . . . .   42
  84.               MENU1 . . . . . . . . . . . . . . . . . . . . . . . . . . .   43
  85.               BOXDEMO2  . . . . . . . . . . . . . . . . . . . . . . . . .   44
  86.  
  87.            Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   46
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.             Page 1                      PowerBatch                      Page 1
  96.  
  97.                                        Introduction
  98.  
  99.             PowerBatch  is a  Shareware product.  Shareware is  a distribution
  100.             method,  not  a  type of  software.  With  Shareware you  get  the
  101.             ultimate  money-back guarantee...if you don't use the product, you
  102.             don't pay for it.
  103.  
  104.             Shareware  is not  free  software. Copyright  laws  apply  to both
  105.             Shareware  and  commercial  software,  and  the  copyright  holder
  106.             retains  all rights,  with a few specific  exceptions as stated in
  107.             this  document.  Shareware authors  are accomplished  programmers,
  108.             just like commercial authors, and the  programs are of  comparable
  109.             quality.  (In  both cases,  you will  find good  programs and  bad
  110.             ones!)  The main difference is  in the method of distribution. The
  111.             author specifically grants  the right  to copy and distribute  the
  112.             EVALUATION  VERSION  of  the software  to  anyone  as long  as  no
  113.             remuneration  is  received for  the distribution  of the  software
  114.             unless permission is granted in writing by the author.
  115.  
  116.             Shareware  distribution  gives  users a  chance  to  try  software
  117.             before  buying it.  If you  try a  Shareware program  and continue
  118.             using  it,  you are  expected to  register the  software with  the
  119.             author.  With registration, you will receive the latest version of
  120.             the  software  without the  evaluation titles  and messages.  With
  121.             shareware you  are able to try the software on  your computer with
  122.             your  own set  of peripherals,  the only  way to  know if  it will
  123.             function  in your own  environment. After deciding that PowerBatch
  124.             is a  software product that  you will  use, then and only  then do
  125.             you  pay for it.  The ultimate trust from the  author! When you do
  126.             pay for  the software,  you pay  only for  the  software, not  for
  127.             advertisement  for the software which can cost many times what the
  128.             software actually costs.
  129.  
  130.             CSD,  Inc.  is   a  member   of  the   Association  of   Shareware
  131.             Professionals  (ASP).   ASP wants to make  sure that the shareware
  132.             principle works for you. If you are unable to  resolve a shareware
  133.             -related  problem  with  an ASP  member by  contacting  the member
  134.             directly,  ASP may be able to help. The ASP Ombudsman can help you
  135.             resolve a  dispute or  problem with  an ASP  member, but does  not
  136.             provide  technical support for  members' products. Please write to
  137.             the  ASP Ombudsman at P.O.  Box 5786, Bellevue, WA 98006 or send a
  138.             Compuserve message via easyplex to ASP Ombudsman 70007,3536.
  139.  
  140.             While CSD has  no immediate plans to move, businesses do move from
  141.             time  to time.  Since shareware tends  to remain on  some bulletin
  142.             boards without  update  for many  years, if  the shareware  author
  143.             does  move, you may experience a problem in contacting the author.
  144.             You may also contact ASP  to learn of the  current address of  any
  145.             ASP member if you experience this problem.
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.             Page 2                      PowerBatch                      Page 2
  154.  
  155.             Trademarks
  156.             ----------
  157.  
  158.             PowerBatch is a trademark of Computing Systems Design, Inc.
  159.             MS-DOS is a trademark of Microsoft Corporation.
  160.             IBM and PC-DOS are trademarks of IBM Corporation.
  161.             ASP, Association of Shareware Professionals,  and the ASP logo are
  162.             registered    trademarks   of   the   Association   of   Shareware
  163.             Professionals.
  164.  
  165.             Liscense Agreement
  166.             ------------------
  167.  
  168.             By  installing  PowerBatch  on  your  system,  you  indicate  your
  169.             agreement  to the  following terms and  conditions. If you  do not
  170.             agree  to these  conditions, you  should not  install and  use the
  171.             PowerBatch   System.  POWERMAK,  SMLMODEL,  and  the  accompanying
  172.             supporting  programs  and   documentation  will   be  collectively
  173.             referred to as PowerBatch.
  174.  
  175.             Users  of  PowerBatch must  accept  this disclaimer  of  warranty:
  176.             "PowerBatch is supplied as is.  The author disclaims all
  177.             warranties,  expressed or  implied, including, without limitation,
  178.             the warranties of  merchantability and of fitness for any purpose.
  179.             The   author  assumes   no  liability   for  damages,   direct  or
  180.             consequential, which may result from the use of PowerBatch."
  181.  
  182.             PowerBatch  is a "shareware program"  and is provided at no charge
  183.             to the user  for evaluation.   Feel free  to share the  EVALUATION
  184.             COPY with your friends, but please do not give  it away altered or
  185.             as  part of  another  system.   The  essence  of  "user-supported"
  186.             software  is  to  provide personal  computer  users  with  quality
  187.             software  without high  prices, and  yet to  provide incentive for
  188.             programmers  to continue  to develop  new products.   If  you find
  189.             this  program useful  and find that  you are using  PowerBatch and
  190.             continue to  use PowerBatch after a 30 day trial  period, you must
  191.             make  a  registration payment  to Computing  Systems Design,  Inc.
  192.             (CSD, Inc.).   The registration fee  will license one copy for use
  193.             on  any  one computer  at  any one  time.    You  must treat  this
  194.             software just like a book.   An example is  that this software may
  195.             be used  by any number of people and may be  freely moved from one
  196.             computer  location to another, so  long as there is no possibility
  197.             of  it  being  used at  one  location  while it's  being  used  at
  198.             another. Just as  a book cannot  be read by two  different persons
  199.             at the same time.
  200.  
  201.             Commercial  users (every user except personal users) of PowerBatch
  202.             must  register and  pay for their  copies of PowerBatch  within 30
  203.             days  of first  use or their  license is withdrawn.   Site-License
  204.             arrangements  may be made  by contacting Computing Systems Design,
  205.             Inc. (CSD, Inc.).
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.             Page 3                      PowerBatch                      Page 3
  214.  
  215.             Anyone  distributing PowerBatch for  any kind of remuneration must
  216.             first  contact Computing Systems  Design, Inc.  (CSD, Inc.) at the
  217.             address  on the  title page for  authorization. This authorization
  218.             will  be automatically  granted to distributors  recognized by the
  219.             (ASP)  as adhering  to its guidelines  for shareware distributors,
  220.             and such distributors  may begin  offering PowerBatch  immediately
  221.             (However Computing Systems Design, Inc.  (CSD, Inc.) must still be
  222.             advised  so that  the distributor can be  kept up-to-date with the
  223.             latest version of PowerBatch.).
  224.  
  225.             You  are encouraged to pass an EVALUATION COPY of PowerBatch along
  226.             to  your  friends  for  evaluation.    Please  encourage  them  to
  227.             register their  copy if  they  find  that they  can use  it.   All
  228.             registered  users will  receive a  copy of  the latest  version of
  229.             PowerBatch.  Distribution of registered  copies of PowerBatch is a
  230.             violation of copyright laws.
  231.  
  232.             To register your copy of PowerBatch, print the file  REGISTER.FRM,
  233.             complete  this form, and send  along with your registration fee to
  234.             CSD,  Inc.  You will  receive the  latest version  of the  program
  235.             along  with the latest documentation. The fully registered version
  236.             of  the program  removes all references  to evaluation. Registered
  237.             users will receive notice of  all updates made to  the program and
  238.             these  updates will be supplied  to registered users for a nominal
  239.             charge.  Every effort will be made to supply updates to registered
  240.             users at the lowest possible cost.
  241.  
  242.             If  you  need  to  submit an  invoice  to  your  accounts  payable
  243.             department,   print  the   form  INVOICE.FRM   and  fill   in  the
  244.             appropriate blanks.
  245.  
  246.             Registration Fees And What You Get
  247.             The   evaluation  version  of  PowerBatch  contains  100%  of  the
  248.             capabilities  of  the  registered  version.   Those  who  register
  249.             PowerBatch will  receive the latest  release of  the software  and
  250.             documentation  and will  receive update  offers in  the mail  at a
  251.             minimal cost  as they  become available.  CSD maintains copies  of
  252.             innovative batch  files submitted  by users  and will  include the
  253.             best of these batch files along with the registered software.
  254.  
  255.             The  registration fee  for PowerBatch is US  $30. Price is subject
  256.             to change without  notice but will  be guaranteed through December
  257.             1990. If  payment is by check, these  funds must be  drawn on a US
  258.             bank.  Unfortunately the  processing of  non-US checks  can  be as
  259.             much as $20 and we cannot afford this type  of transaction. We are
  260.             continually  looking   for  innovative   ways   to  serve   non-US
  261.             customers.
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.             Page 4                      PowerBatch                      Page 4
  270.  
  271.             Software Support
  272.             ----------------
  273.  
  274.             Support for PowerBatch  may be obtained by contacting CSD,Inc.  on
  275.             Compuserve  using Compuserve Mail (EasyPlex). Address inquiries to
  276.             Compuserve  ID 72701,155. If you  are not a Compuserve member, you
  277.             may obtain support by writing to:
  278.  
  279.                               Computing Systems Design, Inc.
  280.                                      P.O. Box 566484
  281.                                Atlanta, Georgia 30356-6009
  282.  
  283.             If  you feel  you have a  question that needs  immediate attention
  284.             and  you are a registered  user, CSD's office hours  are 8AM until
  285.             5PM CST. We will  be happy to discuss any problems or  suggestions
  286.             for PowerBatch but time does  not permit us to help you debug your
  287.             PowerBatch source problems.
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.             Page 5                      PowerBatch                      Page 5
  296.  
  297.                                    Concept Of Operation
  298.  
  299.             PowerBatch  is a  compiler for batch file  "type" commands. At the
  300.             present  time there  are 35  PowerBatch commands  which will  work
  301.             only in  a  PowerBatch source  file (they  will not  execute in  a
  302.             standard  DOS batch  file). Any  valid executable  command (.EXE &
  303.             .COM) as  well as  any of  the  DOS intrinsic  commands are  valid
  304.             within  a PowerBatch  source file  and will  be  "compiled". These
  305.             .EXE,  .COM  and DOS  intrinsic commands  will be  executed via  a
  306.             shell  and  the PowerBatch  .EXE program  will continue  execution
  307.             with  the next  compiled statement following  the shelled command.
  308.             There   are   two   main   modules   supplied   with   PowerBatch;
  309.             1)POWERMAK.EXE  and  2)SMLMODEL.MDL. PowerMak  reads,  parses  the
  310.             source  file,  and compiles  the source  extracting routines  from
  311.             SmlModel.  The result  is a  completely standalone  .EXE file that
  312.             executes  without  SmlModel or  PowerMak.  The increase  in  speed
  313.             comes from  the use  of  the PowerBatch  commands as  the DOS  and
  314.             executable modules will  not be executed any faster. Most  notable
  315.             is  the  increase  in  speed  dealing  with  screen  writes.  Many
  316.             capabilities  are provided in  PowerBatch commands that simply are
  317.             not available with standard DOS commands.
  318.  
  319.                                     Why Use PowerBatch
  320.  
  321.             There  are  four major  reasons  for  using a  compiled PowerBatch
  322.             program:
  323.                  1)  The  resulting  program  will  almost  certainly  execute
  324.                     considerably  faster.   While  it  might  be  possible  to
  325.                     construct  a compiled  PowerBatch  program that  does  not
  326.                     execute faster, it would have to  consist entirely of pre-
  327.                     existing executable modules.
  328.                  2) PowerBatch  commands provide  a  considerable increase  in
  329.                     flexibility and power over conventional batch files.
  330.                  3) PowerBatch  programs  cannot  be  changed  without  making
  331.                     machine   code   modifications.  This   means   additional
  332.                     security for distributed batch files.
  333.                  4)  PowerBatch  programs  can  be  created  quickly  for  the
  334.                     PowerBatch command set is a very high level language.
  335.  
  336.             PowerBatch commands fall into 5 classes of commands;
  337.               1) Commands which  provide systems  information. These  commands
  338.                  provide  the current  color settings,  the current  date, the
  339.                  current  time, check  for  the  existance  of a  valid  drive
  340.                  letter,  and commands  which  check for  the  existance  of a
  341.                  directory or a file.
  342.               2)  Commands  which  control  the  flow of  the  batch  program.
  343.                  Execute  different  portions of  the batch  program based  on
  344.                  existance  or non-existance of directories  or files. Compare
  345.                  the contents  of one  variable with the  contents of  another
  346.                  variable  or a constant and execute different portions of the
  347.                  batch program based on the results of the compare.
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.             Page 6                      PowerBatch                      Page 6
  356.  
  357.               3)  Commands  which  control the  way  text  is printed  on  the
  358.                  screen.  Change any portion of the screen to any valid screen
  359.                  color,  cause a message to  blink on the screen, or highlight
  360.                  a message in reverse video.
  361.               4)  Commands which provide  string manipulation. Change a string
  362.                  to all upper  case characters, or  all lower case characters.
  363.                  Extract  a  portion  of a  string  such  as the  first  three
  364.                  characters or the last  four characters. Build  a new  string
  365.                  from  two  existing  strings  by  concatenation  of  the  two
  366.                  strings.
  367.               5)  Commands which  deal with screen writing  and input from the
  368.                  keyboard.   These  commands   are  the  main   power  in  the
  369.                  PowerBatch system.  Directly  address  any  position  on  the
  370.                  screen and move the cursor to that position to  read or write
  371.                  text. Automatically center  a message  or title on any  line.
  372.                  Draw boxes  around portions of  the screen  to enhance screen
  373.                  appearance. Read  a single key  from the  keyboard, read  the
  374.                  response to a query that only  accepts a yes or  no response,
  375.                  read  a  string  of  characters  from  the  keyboard  with  a
  376.                  specified  maximum length,  and read  keys from  the keyboard
  377.                  automatically changing the characters to upper case.
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.             Page 7                      PowerBatch                      Page 7
  386.  
  387.                                        Installation
  388.  
  389.             Installation is  accomplished by executing  the PBInstal  program.
  390.             It  seemed only  fitting that this  install program be  a compiled
  391.             PowerBatch  program. I  believe this  to be  the epitome  of self-
  392.             installing  software.  The  two  main   modules  POWERMAK.EXE  and
  393.             SMLMODEL.MDL must  be located  in the  DOS  path to  allow you  to
  394.             compile  PowerBatch programs  from any  directory on  your system.
  395.             PowerBatch  may be run  on a system  as small  as a  single floppy
  396.             drive system with 128K. There  will be some limit to the number of
  397.             source statements that  may be compiled on  a system this small as
  398.             memory  is  dynamically  allocated as  compilation  progresses.  A
  399.             source  file of  several hundred statements  can be compiled  on a
  400.             small machine.
  401.  
  402.             PowerBatch may  be installed  from either  drive A, B,  or a  hard
  403.             drive.
  404.  
  405.             If the PowerBatch source is  on a floppy disk, you may execute the
  406.             install procedure by:
  407.  
  408.               1) If your  current drive  is the  A: (or  B:) drive then  enter
  409.                  PBInstal <enter>.
  410.               2)  If you current  drive is other  than A:  (or B:)  then enter
  411.                  A:PBInstal <enter> (or B:PBInstal <enter>).
  412.  
  413.             If you  are installing PowerBatch from  a fixed disk drive such as
  414.             C:, then  make the directory  which contains the PowerBatch source
  415.             the  current  default  directory.  For  example  if  you have  the
  416.             PowerBatch  source in  a directory  named C:\TEMP,  then at  a DOS
  417.             prompt enter
  418.  
  419.             CD \TEMP <enter>
  420.             PBInstal <enter>
  421.  
  422.             You  will  first  be  asked to  enter  the  directory  name  which
  423.             contains the PowerBatch source. Next you will be asked to enter  a
  424.             directory name  on your  DOS  path where  the PowerBatch  compiler
  425.             will be placed.  POWERMAK.EXE and SMLMODEL.MDL  will be  placed in
  426.             this  directory. Before  you begin the  installation process, know
  427.             the name of a directory which is on the DOS  search path where you
  428.             will  place these  two files. The  install program will  not allow
  429.             you to  place the  compiler  in  a directory  that is  not on  the
  430.             search path.
  431.  
  432.             Now  you will be asked  to enter a  directory name where you would
  433.             like  the documentation,  informational, and  example files  to be
  434.             placed. This directory does not  have to be on  your DOS path.  If
  435.             this  directory  does  not  exist,  PowerBatch  will  create  this
  436.             directory   for  you   if  you   desire.  The   documentation  and
  437.             information files will be placed in this directory.
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.             Page 8                      PowerBatch                      Page 8
  446.  
  447.             The  first  time that  you run  the PowerBatch  compiler, it  will
  448.             customize  itself for the computer  on which you are running. This
  449.             process takes about  a minute and  will not run  again. Take  this
  450.             opportunity  to learn about the shareware distribution process and
  451.             how to  register PowerBatch if  after taking it for  a test drive,
  452.             you  feel  you  would  like  to  add  it  to  your  collection  of
  453.             utilities.
  454.  
  455.             We  at CSD  would like  to share  innovative batch  file creations
  456.             with  our customer  base. If  you have  created such  a PowerBatch
  457.             program  and would  like to share it  with other PowerBatch users,
  458.             send it to us and if  we agree with you we  will include it on our
  459.             registration  disk  to  our customers.  You  may  mail us  a  disk
  460.             containing   the  PowerBatch  source   or  you  may  send  it  via
  461.             CompuServe EasyPlex.
  462.  
  463.             Our address is:
  464.               CSD, Inc.
  465.               P.O. Box 566484
  466.               Atlanta, Georgia 30356-6009
  467.  
  468.             Our CompuServe ID is 72701,155.
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.             Page 9                      PowerBatch                      Page 9
  477.  
  478.                           Constructing A PowerBatch Source File
  479.  
  480.             Use  your favorite  text editor to  create a printable  ascii file
  481.             containing   PowerBatch  source   commands  and   DOS   executable
  482.             commands.  A printable ascii file  is one that may be typed to the
  483.             screen  (ie type  myfile.pwr <enter>)  and the  results printed on
  484.             the  screen contain  only the  file  contents. Most  files created
  485.             with  a word  processor are not  printable ascii files  unless you
  486.             specify an ascii file output option.
  487.  
  488.             Compile  your  source  statements  to  create  a  .EXE  executable
  489.             module. This is done using the POWERMAK compiler. The syntax is:
  490.  
  491.                  POWERMAK MyFile [OutFile] [+M]
  492.  
  493.             PowerMake assumes  the extension of the  input file to be .PWR (ie
  494.             MYFILE.PWR)  and will  create an output  file of MYFILE.EXE  if no
  495.             OutFile  parameter is specified. The  input source file may be any
  496.             DOS name  of your  choice(including the  extension). You may  also
  497.             specify an output file name of your choice but the extension  will
  498.             always  be .EXE.  If you do not  enter the input file  name on the
  499.             command line, the  program will prompt you  for the name. You must
  500.             at this time enter the complete name including the extension.
  501.  
  502.             If you wish  to generate a  list of all  literals, variables,  and
  503.             labels  used in your PowerBatch  program, add +M to the end of the
  504.             command  line.   This  variable  map  will   be  written  to   the
  505.             POWERBAT.ERR file.
  506.  
  507.             If the compiler finds no compilation  errors, the compiled version
  508.             of  your  source file  will be  generated. For  an explanation  of
  509.             compilation   errors,  see   the  section   entitled  "Compilation
  510.             Errors".  Compilation errors  appear  on your  screen as  they are
  511.             encountered and they  are written  to a  file named  POWERBAT.ERR.
  512.             The  entire  source  code  is scanned  each  time  you  compile  a
  513.             PowerBatch  program (ie  the compiler does not  stop when an error
  514.             is found, but attempts to identify all errors on each pass).  This
  515.             means  that  some errors  will be  the result  of previous  errors
  516.             found in the source.
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.             Page 10                     PowerBatch                     Page 10
  525.  
  526.                                    PowerBatch Commands
  527.  
  528.             Commands,  Variable  Names, and  Labels  are not  case  sensitive.
  529.             Everything  on the command source  line is converted to upper case
  530.             except  a literal  which is enclosed within  quotes. Either single
  531.             quotes(')  or double  quotes(") may be  used to denote  a literal.
  532.             Literals   which  are  numeric  such  as  color  values,  variable
  533.             lengths,  etc. should not be enclosed in quotes. The compiler does
  534.             evaluate  each  literal  (both alpha  and  numeric)  in  the  same
  535.             manner. The  evaluation process is  1) remove leading and trailing
  536.             quotes if any,  2) attempt  to convert literal  to numeric, 3)  if
  537.             numeric conversion  is successful,  consider it  a  number, 4)  if
  538.             numeric  conversion is  unsuccessful, consider  it  alpha numeric.
  539.             This  means that internally  an operand of 3 and  "3" will both be
  540.             numeric.
  541.  
  542.             A  semicolon which  is not enclosed within  quotes or a  part of a
  543.             command is used to denote a  comment. Semicolons which are part of
  544.             a command must not be  preceded by a space.  A comment begins with
  545.             a  semicolon which follows a space not within quotes. Comments may
  546.             appear  anywhere  on the  command  line,  but  everything after  a
  547.             semicolon on a  command line  is ignored. A  comment may begin  in
  548.             column 1 by placing the  semicolon in column 1.  The following are
  549.             NOT comments:
  550.  
  551.               path=d:\;c:\util;c:\wp
  552.               path   "d:\;c:\util;c:\wp"
  553.               WriteLine   "Punctuation may be used within quotes;"
  554.  
  555.             These ARE comments:
  556.  
  557.               Variable    ColorSave,3 ;save the original color
  558.               SetVar      Msg, ErrMsg ;set Msg to "Invalid input; re-enter"
  559.  
  560.             The starting location on the command line  of the command and  the
  561.             operands is  not important and tabs and spaces may  be freely used
  562.             for readability.
  563.  
  564.             Variable names and command  labels may be any length in the source
  565.             command   but  are  significant   only  through  the  first  eight
  566.             positions.
  567.  
  568.             Variables, Literals, and Labels
  569.  
  570.             A variable is a location  in memory that you  allocate and give  a
  571.             name and a maximum length.  Anytime you refer to the "name" of the
  572.             variable, you are referencing  the memory locations  set aside for
  573.             this  variable. Variable names give  you an easy way to manipulate
  574.             data  internally within  the computer. The  following are examples
  575.             of variables:
  576.               Variable    CharIn,1
  577.                     This  variable  gives  the name  "CharIn"  to  one  memory
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.             Page 11                     PowerBatch                     Page 11
  586.  
  587.                     position. It  will be used to hold one character responses
  588.                     from the keyboard by the user. 
  589.  
  590.               Variable    PBDir,79
  591.                     This  variable appears  in the PBInstal  program and holds
  592.                     the  name of  the directory where  the PowerBatch compiler
  593.                     will  be placed.  It is composed  of the drive  letter and
  594.                     directory   entered  by  the   user  in  response  to  two
  595.                     questions during the installation process.
  596.  
  597.               Variable    CompName,35,"The ABC Company"
  598.                     This  variable reserves  35 positions in  memory and gives
  599.                     these  locations   the  name   CompName.  The   PowerBatch
  600.                     compiler  also places the  initial value "The ABC Company"
  601.                     in  the first  15 positions of the  variable. The value of
  602.                     this variable  may be changed  by later  processing in the
  603.                     program.
  604.  
  605.               Variable    MsgClear,20,"                    "
  606.                     This  variable contains  20 spaces and  is named MsgClear.
  607.                     It  will be  used to "clear"  or overwrite with  spaces an
  608.                     error message in  your program. Once you have displayed  a
  609.                     message  to the user, it should be cleared as you continue
  610.                     with  the  program.  This  is  done  by  overwriting  with
  611.                     spaces.  Having  a variable  with  the correct  number  of
  612.                     spaces makes this task easier.
  613.  
  614.             There  are two  predefined variables  in each  PowerBatch program;
  615.             ERRORLEVEL  and DOSERROR. The ErrorLevel variable and the DOSError
  616.             variable are updated  each time an  external command  is executed.
  617.             If  you execute a program  which sets an  error code on exit, this
  618.             error  code  will  be in  ERRORLEVEL.  The  use of  ERRORLEVEL  in
  619.             PowerBatch  is equivalent  to the use of  ERRORLEVEL in a standard
  620.             DOS batch  file. If you  execute an  external command(program) and
  621.             that  command does  not terminate normally,  the variable DOSERROR
  622.             will  be set  to  the DOS  error code  assigned  by  the operating
  623.             system.  It  is  good practice  to examine  the  DOSERROR variable
  624.             after executing an external command.
  625.  
  626.             Literals are  very much like variables  which have a  value but no
  627.             name.  Literals are  used in PowerBatch commands  when you wish to
  628.             pass an actual  value to the command  instead of a variable.  Note
  629.             in  the following  examples that literals  containing numbers only
  630.             are  not  enclosed  in quotes  and  literals  containing  any non-
  631.             numeric  characters are  enclosed  in  quotes. If  you  specify  a
  632.             number  as a  literal either convention is  acceptable (3 or "3").
  633.             If  you specify  alphabetic characters,  the quotes  are required.
  634.             For readability, and  ease of entry,  numeric literals  usually do
  635.             not contains quotes. Examine the following examples of literals:
  636.  
  637.               Center      "Installation Program",1
  638.                     This  command   will  center  the  literal   "Installation
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.             Page 12                     PowerBatch                     Page 12
  647.  
  648.                     Program" on  line 1 of  the screen. The text "Installation
  649.                     Program"  must  appear somewhere  in  the program  and  it
  650.                     appears as a literal. It will  occupy memory positions and
  651.                     will have a value but you may not reference this value  by
  652.                     name.  By instructing the  compiler to write this literal,
  653.                     the  compiler automatically  creates the  memory locations
  654.                     and  initial value but gives  it no name.  The 1 is also a
  655.                     literal in this command.
  656.  
  657.               WriteAt     12,3,Msg1
  658.                     There are  two literals  in this  command. The  numbers 12
  659.                     and  3 are both created  as literals. In this command they
  660.                     specify the column and row location where the string  Msg1
  661.                     will  be written.  Again, the compiler  creates the memory
  662.                     locations and values  for these literals, but no names. If
  663.                     you  were  to  write  another  command  such  as  the Beep
  664.                     command  which specifies that the system speaker will beep
  665.                     at  a certain  frequency for  3 times,  the compiler  will
  666.                     find  the  previously defined  literal  "3" and  use  this
  667.                     value instead of creating another literal.
  668.  
  669.               Beep        ErrTone,8,3
  670.                     This  is  the  Beep command  referenced  in  the  previous
  671.                     example. The beep  command will cause the speaker to sound
  672.                     at  a  frequency of  ErrTone for  .8 second  and repeat  3
  673.                     times.  The "3" literal will use the  same memory location
  674.                     reference  as  the WriteAt  command used  in the  previous
  675.                     command (ie another literal will not be created).
  676.  
  677.             Labels  are names of a particular place in your PowerBatch program
  678.             that  you will  go to without executing  the previous command. You
  679.             go  directly to this location in the program from another location
  680.             in  the program based on a decision you have  made in the program.
  681.             Examples will help explain:
  682.  
  683.               ReadYN      "Do you wish to continue [Y/N] ",InChar
  684.               Compare     InChar,"Y",,,GetDrive
  685.               Halt        999
  686.               ;end the program if user enters "N"
  687.               Label       GetDrive
  688.                     This  group of  commands writes the message  on the screen
  689.                     and asks  the user  to input either  Y or  N (the  command
  690.                     will  only accept these  two characters). A comparision is
  691.                     then  made to  a literal "Y" and  the compare command will
  692.                     jump  to the  location in the program  named GetDrive if a
  693.                     "Y"  was entered  or will execute the  next command if "N"
  694.                     was entered.
  695.  
  696.               GoTo        NextCmd
  697.               .
  698.               .
  699.               .
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.             Page 13                     PowerBatch                     Page 13
  708.  
  709.               Label       NextCmd
  710.                     In  this most straightforward  use of  the label, the user
  711.                     simply  uses the GoTo command and jumps unconditionally to
  712.                     another point in the program.
  713.  
  714.             External  commands  are entered  just as  PowerBatch commands  are
  715.             entered.  If you  enter an external command  and this command uses
  716.             command line parameters, these parameters may be  passed as either
  717.             variables  or literals.  Remember that  if  the parameter  is  not
  718.             numeric, it must be enclosed in quotes or it will be  treated as a
  719.             variable. Examples:
  720.  
  721.               Variable    InChar,1
  722.               ReadYN      "Do you wish a directory ",InChar
  723.               Compare     InChar,"Y",NextSec,NextSec
  724.               DIR         "/W"
  725.  
  726.               Variable    PgmName,12
  727.               Write       "Enter the name of the program to compile "
  728.               ReadStr     PgmName
  729.               TPC         PgmName, "/ddebug"
  730.  
  731.             This  third example of external  commands show the  use of the two
  732.             predefined  variables,   ERRORLEVEL   and   DOSERROR.  After   the
  733.             execution  of  "TestPgm",  we  examine  DOSError  to  find  if the
  734.             program  executed OK (Possibly there  was not enough memory or the
  735.             program  could not  be found on  the DOS path).  After determining
  736.             that the  program executed  OK, we  examine the  exit code set  by
  737.             "TestPgm"  to determine  the flow  of the  remainder of  our batch
  738.             file. This exit code will be found in the variable ERRORLEVEL.
  739.  
  740.               Variable    MsgLine,80
  741.               .
  742.               .
  743.               TestPgm     "Parm1 Parm2"
  744.               Compare     DOSError,0,,,RanOK
  745.               WriteLine   "TestPgm did not execute properly...terminating"
  746.               Halt        DOSError
  747.               Label       RanOK
  748.               Compare     ErrorLevel,1,Chk2,,Option1
  749.               Concat      MsgLine,"Unexpected return code of ",ErrorLevel
  750.               Halt
  751.               Label       Option1
  752.  
  753.             Note:  PowerBatch  programs may  be executed  by other  PowerBatch
  754.             programs as  external commands.  An option of the  PowerBatch Halt
  755.             command  is  to  set the  DOS  errorlevel.  You could  then  "pass
  756.             parameters"  from  one  PowerBatch  program  to  another  via  the
  757.             ERRORLEVEL variable.
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.             Page 14                     PowerBatch                     Page 14
  766.  
  767.             Command line  parameters may  be passed  to a compiled  PowerBatch
  768.             program. These command line  parameters must be defined at compile
  769.             time and  have special variable names. Up to 16  parameters may be
  770.             passed  to  a  PowerBatch program  and  their  names are  CLP%1  -
  771.             CLP%16.
  772.             If you  wish  to  pass  parameters on  the  command line  to  your
  773.             PowerBatch program, define the variables  in your source  and when
  774.             you  run  the  compiled program,  any  parameters  entered  on the
  775.             command line will be in the defined variable. Example:
  776.  
  777.               Source for SMARTCPY.PWR
  778.  
  779.               Variable    CLP%1,79    ;source file
  780.               Variable    CLP%2,79    ;target file
  781.               Variable    InChar,1
  782.               ReadYN      "Shall I copy the files for you [Y/N] ",InChar
  783.               Compare     InChar,"Y",NoCopy,NoCopy
  784.               COPY        CLP%1, CLP%2
  785.  
  786.               SMARTCPY  FILE1 FILE2 will execute the DOS copy command and copy
  787.             FILE1 to FILE2 if the user responds Y to the question.
  788.  
  789.             Changes To Your Computer's Environment Area
  790.             Your  computer memory contains a special area of memory called the
  791.             "Environment  Area".  This special  area  of memory  contains  the
  792.             values  assigned to  variables  that  are  available  to  the  DOS
  793.             operating system  or to  any application program  running in  your
  794.             computer.   These  values   remain  unchanged  until   DOS  or  an
  795.             application program changes  them as long  as the  power is on  to
  796.             your  computer. DOS maintains  special values  in this  area which
  797.             the operating  system uses. Your current  path and current  prompt
  798.             configuration  are two of  these values. These values are normally
  799.             set  with  the  DOS PROMPT  or  PATH  command. If  an  application
  800.             program   like  a  compiled  PowerBatch  program  executes  a  DOS
  801.             command,  it is done via a "shell" or another copy of your command
  802.             processor  (normally COMMAND.COM)  which is started  to handle the
  803.             execution  of these  DOS commands.  When a  shell is  started, DOS
  804.             creates a  copy of  the environment  area for this  new shell  and
  805.             makes   the   environment   values   available   to   the   shell.
  806.             Unfortunately, when the shell is terminated (when the DOS  command
  807.             is  complete) this copy of  the environment is erased from memory.
  808.             If you execute a PROMPT, PATH or SET [Variable] command, the  copy
  809.             of  the environment created for the shell to run the PROMPT, PATH,
  810.             or  SET command is updated and immediately erased when the command
  811.             is  finished.  PowerBatch  provides you  a  means  to  update  the
  812.             permanent copy  of the environment area with the commands SETPATH,
  813.             SETENV, PROMPT.
  814.  
  815.             Command Notation
  816.             In  the  description of  the  commands  which follow,  that  which
  817.             appears  within brackets  [ ] is  optional and all  other operands
  818.             are required.  Any  time a  screen color  may  be  specified in  a
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.             Page 15                     PowerBatch                     Page 15
  827.  
  828.             command such as
  829.  
  830.               CLEARLINE LineNumber,ForegroundColor,BackgroundColor
  831.  
  832.             the  single attribute which is  used in many color conventions may
  833.             be  substituted for  the  pair of  color attributes.  For example,
  834.             foreground color 4 (red), background  color 1 (blue), is identical
  835.             to  color attribute 20 and  the CLEARLINE command may be specified
  836.             EITHER as 
  837.  
  838.               CLEARLINE 14,4,1
  839.             or
  840.               CLEARLINE 14,20
  841.  
  842.             to  clear  line  14 on  the  screen  to  red  foreground  on  blue
  843.             background.  For  this reason  anytime  that  the operand  pair of
  844.             foreground  color, background color  is required, the single color
  845.             attribute  may be substituted for  the pair. The compiler will not
  846.             detect  missing background  color attributes but  will assume that
  847.             the foreground is the composite value.
  848.  
  849.             Command Syntax
  850.             The  number which  is immediately  under the  command name  is the
  851.             line  number in  the DEMO1 file (printed  in the examples section)
  852.             which uses this command.
  853.  
  854.             ?COLOR        VarName1, VarName2, VarName3
  855.             (25) Retrieve  the current  color attributes  from the  system and
  856.                     place  the  current  foreground  color  in  VarName1,  the
  857.                     current  background color  in VarName2,  and the composite
  858.                     attribute in VarName3.
  859.  
  860.                  Ex:   Variable ForeColor,3
  861.                        Variable BackColor,3
  862.                        Variable ColorAttr,3
  863.                        ?Color   ForeColor,BackColor,ColorAttr
  864.  
  865.                     Retrieve  the current foreground, background and composite
  866.                        color  values and  place  in  the variables  ForeColor,
  867.                        BackColor, and ColorAttr repectively.
  868.  
  869.             ?CURRDIR      VarName1, VarName2
  870.                  Retrieve the current drive and  directory from the system and
  871.                     place  the  current  drive in  VarName1  and  the  current
  872.                     directory  in VarName2. The  contents of VarName1 prior to
  873.                     execution of this command  control which currently  logged
  874.                     drive  is searched for  the currently logged directory. If
  875.                     ?CurrDir finds a valid drive letter  in the first position
  876.                     of VarName1,  then the  contents of VarName2  will be  the
  877.                     currently  logged directory  of that  drive. If  the first
  878.                     position  of  VarName1  does not  contain  a  valid  drive
  879.                     letter, then  VarName2 will contain  the currently  logged
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.             Page 16                     PowerBatch                     Page 16
  888.  
  889.                     directory  of the  current drive. In  either case VarName1
  890.                     will  contain  the drive  and  VarName2 will  contain  the
  891.                     directory.
  892.  
  893.                  Ex:   Variable    CurrDrive,2
  894.                        Variable    CurrDir,79
  895.                        Set         CurrDrive,"A"
  896.                        ?CurrDir    CurrDrive,CurrDir
  897.                        Set         CurrDrive,""
  898.                        ?CurrDir    CurrDrive,CurrDir
  899.  
  900.                  In the first usage of ?CurrDir,  assuming that the  currently
  901.                     logged directory  on the  A drive is  the root  directory,
  902.                     CurrDrive  will contain  "A" and CurrDir  will contain "\"
  903.                     after  the  execution of  ?CurrDir. In  the second  usage,
  904.                     assuming that the  currently logged  drive is  D: and  the
  905.                     currently   logged   directory  on   the   D:   drive   is
  906.                     "\UTIL\EXEC", CurrDrive will contain  "D" and CurrDir will
  907.                     contain "\UTIL\EXEC" after the execution of ?CurrDir.
  908.  
  909.             ?DATE         VarName1, VarName2, VarName3, VarName4
  910.             (26) Retrieve  the current date from  the system and place the day
  911.                     of  the week  in VarName1, the month  in VarName2, the day
  912.                     in VarName3, and  the year in VarName4. VarName1 should be
  913.                     defined  as 9  long, VarName2 and VarName3  as 2 long, and
  914.                     VarName4 as 4 long.
  915.  
  916.                  Ex:   Variable DOW,9
  917.                        Variable Mo,2
  918.                        Variable Da,2
  919.                        Variable Yr,4
  920.                        ?Date    DOW,Mo,Da,Yr
  921.  
  922.                     Retrieve  the current  date and place  the component parts
  923.                        in  their respective  variables. Place  the day  of the
  924.                        week  in DOW (ie Saturday),  the month number in Mo (ie
  925.                        06), the day of the  month in Da (ie  29), and the year
  926.                        in Yr (ie 1990).
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.             Page 17                     PowerBatch                     Page 17
  935.  
  936.             ?DIREXIST     VarName1, Label1 [,Label2]
  937.             (159)         Literal1,Label1 [,Label2]
  938.                  Check  the system for  the existance  of the  directory whose
  939.                     name appears in VarName1 or in Literal1. If the  directory
  940.                     exists  jump to the  command immediately following Label1,
  941.                     if the  directory  does  not exist,  jump to  the  command
  942.                     immediately following Label2.
  943.  
  944.                  Ex:   ?DirExist   InpStr,DirOk,BadDir
  945.                        ?DirExist   "C:\",DirOK,BadDir
  946.                        ?DirExist   InpStr,,BadDir (next command if exists)
  947.                        ?DirExist   InpStr,DirOk   (next command if not exist)
  948.                  In  the first example if  the contents of the variable InpStr
  949.                     exists then  goto label DirOK, if it does not  exist go to
  950.                     the  label BadDir. In the  second example we check for the
  951.                     existance  of  a literal  with a  value of  "C:\". In  the
  952.                     third example, if the  contents of InpStr  exist we  "fall
  953.                     through"  to the  next instruction, if  the directory does
  954.                     not  exist  we jump  to the  label BadDir.  In the  fourth
  955.                     example, if the directory  name in InpStr  exists, we jump
  956.                     to  the label DirOK, if  it does not exist we fall through
  957.                     to the next command.
  958.  
  959.             ?DISKSPACE    VarName1, VarName2, VarName3
  960.             (184)         Literal1, VarName1, VarName2
  961.                  Query  the disk  Drive specified  by the  first  character of
  962.                     Varname1 and  place the  total disk capacity  in bytes  in
  963.                     VarName2  and  the unused  bytes  in VarName3.  Since  the
  964.                     command looks at only  the first character of VarName1 (or
  965.                     Literal1),  VarName1   may   contains   strings  such   as
  966.                     "C:\UTIL".
  967.                  Ex:   Variable    DirName,79
  968.                        ReadStr     DirName  (user enters "c:\util")
  969.                        Upper       DirName  (changes to "C:\UTIL")
  970.                        ?DiskSpace  DirName,TotSpace,FreSpace
  971.  
  972.                        ?DiskSpace  "A",TotSpace,FreSpace
  973.  
  974.             ?DRIVEEXIST   VarName1, Label1 [,Label2]
  975.             (145)         Literal1, Label1 [,Label2]
  976.                  Check  the system  for VarName1 as  a valid drive  letter. If
  977.                     the  drive  is  valid, jump  to  the  command  immediately
  978.                     following  Label1, if  the drive is not  valid jump to the
  979.                     command immediately following Label2.
  980.  
  981.                  Ex:   ?DriveExist DrvNum,GoodDrv,BadDrv
  982.                        ?DriveExist "A",GoodDrv,BadDrv
  983.                        ?DriveExist DrvNum,,BadDrv
  984.                        ?DriveExist DrvNum,GoodDrv
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.             Page 18                     PowerBatch                     Page 18
  993.  
  994.             ?ENVSTR       VarName1, VarName2
  995.                           Literal1, VarName2
  996.                  Retrieve  the contents  of any environment  variable from the
  997.                     system  environment  area.  The  name  of  the environment
  998.                     variable  is placed  in VarName1  or entered as  a literal
  999.                     and  the  contents of  the  environment variable  will  be
  1000.                     placed  in VarName2. Ensure that VarName2 has been defined
  1001.                     sufficiently  long enough  to contain the  contents of the
  1002.                     environment  variable. If VarName2 is not long enough, the
  1003.                     environment variable will be truncated.
  1004.  
  1005.                  Ex:   Variable    EnvValue,255
  1006.                        Variable    EnvName,4,"path"
  1007.                        ?EnvStr     "prompt", EnvValue
  1008.                        ?EnvStr     EnvName, EnvValue
  1009.  
  1010.             ?FILEEXIST    VarName1, Label1 [,Label2]
  1011.             (172)         Literal, Label1 [,Label2]
  1012.                  Check  the system  for the specified  file name. If  the file
  1013.                     exists, jump to the command  immediately following Label1,
  1014.                     if  the  file  does  not  exist,   jump  to  the   command
  1015.                     immediately following Label2.
  1016.  
  1017.                  Ex:   ?FileExist  FileName, Label1, Label2
  1018.                        ?FileExist  "C:\AUTOEXEC.BAT",StartOK,NoStart
  1019.                        ?FileExist  FileName,,Label2
  1020.                        ?FileExist  FileName,Label1
  1021.  
  1022.             ?INPATH       VarName1, Label1 [,Label2]
  1023.                           Literal1, Label2 [,Label2]
  1024.                  Compare the contents  of VarName1 to the system search  path.
  1025.                     If  VarName1  is contained  within the  path  jump to  the
  1026.                     command  immediately  following Label1,  if the  file does
  1027.                     not  exist  jump  to  the  command  immediately  following
  1028.                     Label2. Use this command  to determine if  a directory  is
  1029.                     specified in the DOS search path.
  1030.  
  1031.                  Ex:   DOS search path contains "C:\UTIL;C:\WORDPROC;D:\"
  1032.                        Variable    InString,79
  1033.                        Write       "Enter your directory name "
  1034.                        ReadStr     InString (user enters "c:\wordproc")
  1035.                        Upper       InString (change to "C:\WORDPROC")
  1036.                        ?InPath     InString,PathOK,BadPath
  1037.  
  1038.                        ?InPath     "C:\UTIL",,BadPath   (compare literal)
  1039.  
  1040.             ?TIME         VarName1
  1041.             (27) Retrieve  the  current time  from  the  system  and place  in
  1042.                     VarName1. The format of the time is hh:mm:ss xm.  VarName1
  1043.                     should be defined as 11 long.
  1044.                  Ex:   Variable CurrTime,11
  1045.                        ?Time    CurrTime (now contains 11:24:14 am)
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.             Page 19                     PowerBatch                     Page 19
  1054.  
  1055.  
  1056.  
  1057.             BEEP          VarName1, VarName2, VarName3
  1058.             (149)         Literal1, Literal2, Literal3
  1059.                  Sound  the system speaker  with a tone of VarName1 frequency,
  1060.                     for  a length  of VarName2 tenths of  a second, and repeat
  1061.                     VarName3 times.
  1062.                  Ex:   Beep  800,5,3
  1063.                        Beep  ErrFreq,BeepLen,ErrTimes
  1064.                     The first  example sound the system speaker at a frequency
  1065.                        of 800 hz  for half a second (.5) and repeats twice for
  1066.                        a  total of 3 times.  The second example will sound the
  1067.                        system speaker at a frequency equal to the contents  of
  1068.                        the  variable ErrFreq for BeepLen tenths of a second(s)
  1069.                        for a total of ErrTimes.
  1070.  
  1071.             BLINK
  1072.             (82)
  1073.                  Cause  all text that is written to the  screen to blink using
  1074.                     the  current  color   attributes  last   defined  in   the
  1075.                     processing  of the batch program. This command in "undone"
  1076.                     by using NORMAL.
  1077.  
  1078.                  Ex:   Variable MsgClear,25."                         "
  1079.                        Blink
  1080.                        WriteAt  15,4,"Not a valid entry"
  1081.                        Normal
  1082.                        Wait     35
  1083.                        WriteAt  15,4,MsgClear
  1084.                     Write the message "Not a valid entry" at  column 15 on row
  1085.                        4  using the  current color definition.  Reset the text
  1086.                        color  to  the  value  it  contained  before specifying
  1087.                        blinking text. Wait 3.5 seconds and clear the message.
  1088.  
  1089.             BOX1          VarNm1, VarNm2, VarNm3, VarNm4, VarNm5 [,VarNm6]
  1090.             (36)          Lit1, Lit2, Lit3, Lit4, Lit5 [,Lit6]
  1091.                  Draw  a  box  (frame) on  the  screen  whose upper  left  co-
  1092.                     ordinates  (X,Y) are VarNm1, VarNm2, and whose lower right
  1093.                     co_ordinates  (X,Y) are VarNm3, VarNm4. Draw the box using
  1094.                     a  line  in foreground  color VarNm5  on background  color
  1095.                     VarNm6.
  1096.  
  1097.                  Ex:   Variable ULX,2,5     ;upper left col value
  1098.                        Variable ULY,2,3     ;upper left row value
  1099.                        Variable LRX,2,75    ;lower right col value
  1100.                        Variable LRY,2,20    ;lower right row value
  1101.                        Variable BoxFore,2,4 ;foreground color red
  1102.                        Variable BoxBack,2,0 ;background color black
  1103.                        Box1  ULX, ULY, LRX, LRY, BoxFore, BoxBack
  1104.                        Box1  5,3,75,20,7,0
  1105.                        Box1  5,3,75,20,112
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.             Page 20                     PowerBatch                     Page 20
  1114.  
  1115.                     The  first  example  draws  a  box whose  upper  left  co-
  1116.                        ordinates  are the  contents of  the variables  ULX and
  1117.                        ULY  and whose lower left co-ordinates are the contents
  1118.                        of  the variables  LRX and LRY. The  box border will be
  1119.                        the  contents  of  BoxFore (red)  on  a  background  of
  1120.                        BoxBack  (black).  The  interior of  the  box  will  be
  1121.                        unchanged  (ie it  is  not  cleared  nor is  the  color
  1122.                        changed).  The second  example draws a  box whose upper
  1123.                        left  co-ordinates are  5,3 and  whose lower  right co-
  1124.                        ordinates are  75,20. The box  border is drawn in white
  1125.                        on  black. The third example  draws a box with the same
  1126.                        co-ordinates  and uses the composite color attribute of
  1127.                        112 (white on black). See ClearBox command.
  1128.  
  1129.             BREAKON
  1130.                  Provides a  capability to exit  from a  PowerBatch program by
  1131.                     pressing  the  combination  of  keys  (Ctrl  -  Break)  or
  1132.                     (Ctrl - C). The default value  set at the beginning of any
  1133.                     PowerBatch  program  is  BreakON.  To  keep  a  user  from
  1134.                     exiting   a  running   PowerBatch  program,   execute  the
  1135.                     BreakOFF  command. If sections  of the  program are  to be
  1136.                     protected and  other sections not,  surround the  sections
  1137.                     with pairs of BreakON...BreakOFF commands.
  1138.  
  1139.             BREAKOFF
  1140.                  Disables   the  ability  to  stop  a  PowerBatch  program  by
  1141.                     pressing  the   (Ctrl  -   Break)  or  (Ctrl   -  C)   key
  1142.                     combinations.  The default  value set at  the beginning of
  1143.                     any PowerBatch program is BreakON.
  1144.  
  1145.             CENTER        VarName1, VarName2
  1146.             (42)          Literal1, Literal2
  1147.                  Center the text in VarName1 on line VarName2.
  1148.  
  1149.                  Ex:   Variable InpStr,25,"PowerBatch"
  1150.                        Center   "PowerBatch",2
  1151.                        Center   InpStr,2
  1152.  
  1153.                     Both  versions  of  this  example  will  center  the  name
  1154.                        "PowerBatch" on line 2 of the screen.
  1155.  
  1156.             CLEAR         VarName1 [,VarName2]
  1157.             (28)          Literal1 [,Literal2]
  1158.                  Clear  the  entire screen  to foreground  color VarName1  and
  1159.                     background color VarName2.
  1160.  
  1161.                  Ex:   Variable ColorAttr,3,112   ;define white on black
  1162.                        Clear    4,1
  1163.                        Clear    112
  1164.                        Clear    ColorAttr
  1165.                     The  first example  clears the screen to  red on blue. The
  1166.                        second and third examples clear  the screen to white on
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.             Page 21                     PowerBatch                     Page 21
  1175.  
  1176.                        black.
  1177.  
  1178.             CLEARBOX      VarNm1, VarNm2, VarNm3, VarNm4, VarNm5 [,VarNm6]
  1179.             (37)          Lit1, Lit2, Lit3, Lit4, Lit5 [,Lit6]
  1180.                  Clear  the interior of  the box whose upper left co-ordinates
  1181.                     (X,Y)  are  VarNm1,  VarNm2  and  whose  lower  right  co-
  1182.                     ordinates  (X,Y) are VarNm3, VarNm4. Clear the interior of
  1183.                     the  box to  foreground color VarNm5  and background color
  1184.                     VarNm6. This command  clears the "inside" of the box,  not
  1185.                     the lines which describe the box.
  1186.                  Ex:   Variable ULX,2,5     ;upper left col value
  1187.                        Variable ULY,2,3     ;upper left row value
  1188.                        Variable LRX,2,75    ;lower right col value
  1189.                        Variable LRY,2,20    ;lower right row value
  1190.                        Variable BoxFore,2,4 ;foreground color red
  1191.                        Variable BoxBack,2,0 ;background color black
  1192.                        Box1     ULX, ULY, LRX, LRY, BoxFore, BoxBack
  1193.                        ClearBox 5,3,75,20,112
  1194.  
  1195.                     In  this example we define  the upper right and lower left
  1196.                        co-ordinates of the box as well  as the colors  BoxFore
  1197.                        and  BoxBack. We  draw  the box  with a  red line  on a
  1198.                        black  background.  The  ClearBox  command  clears  the
  1199.                        interior of the box to white on black.
  1200.  
  1201.             CLEARLINE     VarName1, VarName2 [,VarName3]
  1202.                           Literal1, literal2 [,Literal3]
  1203.                  Clear the  line number specified  by VarName1 to a foreground
  1204.                     color of VarName2 and a background color of VarName3.
  1205.  
  1206.                  Ex:   Variable    Red,1,4
  1207.                        Variable    Blue,1,1
  1208.                        Variable    RedOnBlue,2,20
  1209.                        Variable    CurrLine,2,12
  1210.                        ClearLine   12,Red,Blue
  1211.                        ClearLine   CurrLine,RedOnBlue
  1212.  
  1213.                     Both  examples of the  ClearLine command  clear line 12 on
  1214.                        the  screen to red foreground color and blue background
  1215.                        color.
  1216.  
  1217.             COLOR         VarName1 [,VarName2]
  1218.             (38)          Literal1 [,Literal2]
  1219.                  Set  the  default  color to  foreground  color  VarName1  and
  1220.                     background color  VarName2 or optionally  set the  default
  1221.                     color attribute to VarName1.
  1222.                  Ex:   Variable RedOnBlue,2,20
  1223.                        Color    4,1
  1224.                        Color    MenuClr
  1225.  
  1226.                     Both  examples set  the default color  to red on  blue for
  1227.                        any  text written to  the screen without specific color
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.             Page 22                     PowerBatch                     Page 22
  1236.  
  1237.                        instructions.
  1238.  
  1239.             COMPARE    VarName1, VarName2, Label1 [,Label2] [,Label3]
  1240.             (30)       Literal1, Literal2, Label1 [,Label2] [,Label3]
  1241.                  Compare   the  contents  of   VarName1  to  the  contents  of
  1242.                     VarName2.  If VarName1  greater than VarName2  jump to the
  1243.                     statement  following   Label1.  If   VarName1  less   than
  1244.                     VarName2  jump  to  the  statement  following  Label2.  If
  1245.                     VarName1  equal VarName2  jump to  the statement following
  1246.                     Label3.   If  the  contents  of  the  first  two  operands
  1247.                     (VarName1,  VarName2, Literal1,  or Literal2)  are numeric
  1248.                     then   a  numeric   compare  is  performed   otherwise  an
  1249.                     alphabetic   compare   is  made.   (If   19   is  compared
  1250.                     alphabetically to  2, then 2 is greater than 19;  if it is
  1251.                     compared numerically, 19 is greater than 2.)
  1252.  
  1253.                  Ex:   Variable InChar,1
  1254.                        Variable Yes,1,"Y"
  1255.                        Variable No,1,"N"
  1256.                        GoToXY   4,23
  1257.                        ReadYN   "Incorrect entry...Continue [Y/N] "
  1258.                        Compare  InChar,"Y",NoIn,NoIn,YesIn
  1259.  
  1260.                        Compare  InChar,Yes,,,YesIn   (Not Y falls thru)
  1261.  
  1262.                        Compare  InChar,"Y",NoIn,NoIn (Y falls thru)
  1263.  
  1264.                     In  the  first example  of the  Compare command,  variable
  1265.                        InChar  is  compared  to  literal  "Y".  If  InChar  is
  1266.                        greater than  "Y" then  the program  will  jump to  the
  1267.                        label NoIn;  if InChar  is less than  "Y", the  program
  1268.                        also  jumps to  the label NoIn;  if InChar is  equal to
  1269.                        "Y",  the program will continue processing at the label
  1270.                        named  YesIn.  In  the  second   compare  command,  the
  1271.                        variable  InChar is compared  to the variable Yes which
  1272.                        has an  assigned value of "Y".  If the variable  InChar
  1273.                        contains anything but  "Y", the program  continues with
  1274.                        the  next instruction after  the compare command (it is
  1275.                        said  to  fall through);  if InChar  contains "Y",  the
  1276.                        program  will jump  to the  label YesIn.  In the  third
  1277.                        compare  command, variable  InChar is  compared  to the
  1278.                        literal  "Y".  If  the  variable  InChar  contains  "N"
  1279.                        (ReadYN  prevents any  entry but  Y  or N)  the program
  1280.                        jumps  to the  label NoIn  otherwise it  continues with
  1281.                        the instruction after the compare command.
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.             Page 23                     PowerBatch                     Page 23
  1290.  
  1291.             CONCAT     VarName1, VarName2 [,VarName3]
  1292.             (116)      VarName1, Literal1 [,Literal2]
  1293.                  Concatenate  the  string  in  VarName2  with  the  string  in
  1294.                     VarName3 and place the result in VarName1. If VarName3  is
  1295.                     not  present then concatenate  the string in VarName1 with
  1296.                     the string in VarName2 and place the result in VarName1.
  1297.                  Ex:   Variable    OutMsg,78
  1298.                        Variable    ErrMsg," is not a valid Drive letter."
  1299.                        Variable    DriveLtr,1
  1300.                        WriteAt     6,17,"Enter your source drive letter "
  1301.                        ReadUpKey   DriveLtr
  1302.                        ?DriveExist DriveLtr,DriveOK
  1303.                        Concat      OutMsg, "[19] ", DriveLtr
  1304.                        Concat      OutMsg, " is not a valid Drive letter."
  1305.                        WriteAt     5,23,OutMsg
  1306.  
  1307.                     In  this example we  ask the  user to input  a valid drive
  1308.                        letter  and  verify  this  drive  with  the ?DriveExist
  1309.                        command.  If  the drive  is  not valid  we  concatenate
  1310.                        "[19]"  (the  error  number)  plus   the  drive  letter
  1311.                        entered by the user into the  variable OutMsg. We  then
  1312.                        concatenate the error  message (" is not a valid  Drive
  1313.                        letter.")  onto  the  contents  of  OutMsg. The  result
  1314.                        would  be something  like "[19] L is  not a valid Drive
  1315.                        letter."
  1316.  
  1317.             GOTO       Label1
  1318.             (152)
  1319.                  Jump to the statement identified as command label Label1.
  1320.                  Ex:   GoTo  Error
  1321.                        GoTo  EndOfPgm
  1322.  
  1323.             GOTOXY     VarName1, VarName2
  1324.             (57)       Literal1, Literal2
  1325.                  Move  the cursor to the  column (X) specified in VarName1 and
  1326.                     row (Y) specified in VarName2.
  1327.                  Ex:   Variable CurrX,2
  1328.                        Variable CurrY,2
  1329.                        GoToXY   CurrX, CurrY
  1330.                        GoToXY   12,6
  1331.  
  1332.                     In  the first example the  cursor is moved to the location
  1333.                        specified  by the contents of variable CurrX and CurrY.
  1334.                        In  the second  example,  the cursor  is  moved  to the
  1335.                        location specified by two literals "12" and "6".
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.             Page 24                     PowerBatch                     Page 24
  1344.  
  1345.             HALT       VarName1
  1346.                        Literal1
  1347.                  Halt the  batch file  processing and  set  DOS errorlevel  to
  1348.                     VarName1.
  1349.                  Ex:   Variable Error14,2,14   ;define Error14 as "14"
  1350.                        Halt     99
  1351.                        Halt     Error14
  1352.  
  1353.                     In the  first usage  of the Halt  command, the  PowerBatch
  1354.                        program  is halted and the DOS errorlevel is set to 99.
  1355.                        In  the second usage the  program is halted and the DOS
  1356.                        errorlevel  is set to  the contents of variable Error14
  1357.                        ("14").
  1358.  
  1359.             LABEL      LabelName
  1360.             (34) Define  a location  in the list of  commands that will enable
  1361.                     execution  to  begin  immediately following  this  command
  1362.                     without    necessarily   having   executed   the   command
  1363.                     immediately  prior to the  Label. Jump immediately to this
  1364.                     location  in  the command  stream. See  the discussion  on
  1365.                     labels at the beginning of this section.
  1366.  
  1367.                  Ex:   Label    MatchErr
  1368.                        Label    EndOfPgm
  1369.  
  1370.             LENGTH     VarName1, VarName2
  1371.             (129)      VarName1, Literal1
  1372.                  Calculate the  length of the  string in variable VarName2 and
  1373.                     place the result in VarName1.
  1374.                  Ex:   Variable InString
  1375.                        Variable StrLen
  1376.                        WriteAt  12,14,"Enter your current directory "
  1377.                        ReadStr  InString (user enters c:\util)
  1378.                        Length   StrLen, InString  (StrLen will contain 7)
  1379.  
  1380.             LOWER      VarName1
  1381.             (104)
  1382.                  Change the alphabetic characters in VarName1 to lower case.
  1383.                  Ex:   Variable InString,25
  1384.                        ReadStr  InString (user enters C:\UTIL)
  1385.                        Lower    InString (now contains c:\util)
  1386.  
  1387.             MIDSTRING  VarName1, VarName2, VarName3, VarName4
  1388.             (114)      VarName1, Literal1, Literal2, Literal3
  1389.                  Extract  a substring of VarName2 beginning at offset VarName3
  1390.                     into VarName2  for  a length  of VarName4  and place  this
  1391.                     substring in VarName1.
  1392.  
  1393.                  Ex:   Variable Path,79
  1394.                        WriteAt     1,2,"Enter Drive and Directory name "
  1395.                        ReadStr     Path  (user enters C:\UTIL)
  1396.                        MidString   Drive,Path,1,2 (extract C: from C:\UTIL)
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.             Page 25                     PowerBatch                     Page 25
  1405.  
  1406.  
  1407.             NORMAL
  1408.             (84) Change  the current color attribute(s) back to the definition
  1409.                     prior to the execution of a BLINK or REVERSE command.
  1410.  
  1411.                  Ex:   Color    20    ;set default color to red on blue
  1412.                        Blink          ;changes to blinking red on blue (148)
  1413.                        WriteAt  2,24,"Incorrect...re-enter!"
  1414.                        Normal         ;resets color to 20
  1415.                        Beep     800,8
  1416.                        Wait     35    ;pause 3.5 seconds
  1417.                        WriteAt  2,24,"                    "   ;clear     error
  1418.             msg
  1419.  
  1420.                     This  is an example of  a typical error routine. The color
  1421.                        attribute  is  changed   to  blinking  with  the  Blink
  1422.                        command.  The error  message is  written and  the color
  1423.                        attribute  is changed  back to its  original value with
  1424.                        the  Normal command. The  speaker is "beeped" and after
  1425.                        a wait  of 3.5  seconds, the  error message  is removed
  1426.                        from the screen.
  1427.  
  1428.             PROMPT     VarName1
  1429.                        Literal1
  1430.                  Change  the  current  value  of   the  prompt  to  the  value
  1431.                     specified in VarName1 or in Literal1.
  1432.  
  1433.                  Ex:   Prompt      "$p$g"
  1434.              
  1435.             READKEY    VarName1
  1436.             (59) Read a single key  from the keyboard and place the result  in
  1437.                     VarName1.
  1438.  
  1439.                  Ex:   Variable CharIn,1
  1440.                        GoToXY   1,14
  1441.                        Write    "Enter the drive letter for output ",4,1
  1442.                        ReadKey  CharIn
  1443.  
  1444.             READSTR    VarName1
  1445.             (109)
  1446.                  Read  a string of characters from the keyboard until the user
  1447.                     presses  the enter  key. Any  number of  characters may be
  1448.                     read up  to the maximum  length specified  for VarName1 in
  1449.                     the Variable statement.
  1450.  
  1451.                  Ex:   Variable    InString,12
  1452.                        ReadStr     InString    (12 chars max will be read)
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.             Page 26                     PowerBatch                     Page 26
  1461.  
  1462.             READUPKEY  VarName1
  1463.             (144)
  1464.                  Read a single character from the  keyboard, changing the case
  1465.                     of any alphabetic  character to upper case and place  this
  1466.                     upper case character in VarName1.
  1467.  
  1468.                  Ex:   ReadUpKey   CharIn
  1469.  
  1470.             READYN     VarName1, VarName2
  1471.             (29)       Literal1, VarName2
  1472.                  Write the  message found  in VarName1  at the  current cursor
  1473.                     location and wait for a  single key to be entered from the
  1474.                     keyboard. Force the user to enter either  a "Y" or "N" and
  1475.                     place the upper case "Y" or "N" in VarName2.
  1476.  
  1477.                  Ex:   Variable    Msg4,35,"Invalid filename...Continue  [Y/N]
  1478.             "
  1479.                        ReadYN      "Invalid     filename...Continue      [Y/N]
  1480.             ",CharIn
  1481.  
  1482.                        ReadYN      Msg4,CharIn
  1483.  
  1484.                  In  both usages  of the ReadYN command,  the message "Invalid
  1485.                     filename...Continue  [Y/N] "  will  be displayed  and  the
  1486.                     program  will wait  for a response  from the user.  If the
  1487.                     user enters any characters  other than "Y",  "y", "N",  or
  1488.                     "n"  the  system  speaker  will  sound  and  the  user  is
  1489.                     prompted  again  for  input. At  the  completion  of  this
  1490.                     command,  the variable  CharIn will contain  either "Y" or
  1491.                     "N" (always upper case).
  1492.  
  1493.             REVERSE
  1494.                  Change  the  text  attributes to  "reverse  video".  This  is
  1495.                     accomplished  by swapping  the foreground  and  background
  1496.                     attributes. This command is "undone" by using NORMAL.
  1497.  
  1498.                  Ex:   Color    20    ;red on black
  1499.                        Reverse        ;color is changed to black on red
  1500.                        WriteAt  1,15,"Press Escape To Continue"
  1501.                        Normal         ;color is now red on black
  1502.  
  1503.             SETENV     VarName1, VarName2
  1504.                        Literal1, Literal2
  1505.                  Set  the  value  of the  environment  variable  specified  in
  1506.                     VarName1  or Literal1  to the value  specified in VarName2
  1507.                     or Literal2.
  1508.  
  1509.                  Ex:   Variable    VarName,7,"MONITOR"
  1510.                        Variable    VarValue,5,"color"
  1511.                        SetEnv      VarName, VarValue
  1512.                        SetEnv      "Monitor","color"
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.             Page 27                     PowerBatch                     Page 27
  1521.  
  1522.             SETPATH    VarName1
  1523.                        Literal1
  1524.                  Set  the current  path to the value  specified in VarName1 or
  1525.                     the value specified in Literal1.
  1526.  
  1527.                  Ex:   Variable NewPath,40,"d:\;c:\util\exec;c:\dos"
  1528.                        SetPath  NewPath
  1529.                        SetPath  "d:\;c:\;"
  1530.  
  1531.             SETVAR     VarName1, VarName2
  1532.             (31)       VarName1, Literal1
  1533.                  Set the value of VarName1 to the contents of VarName2.
  1534.  
  1535.                  Ex:   Variable ErrCode,3
  1536.                        Variable FileName,79
  1537.                        SetVar   ErrCode,99
  1538.                        SetVar   FileName,"C:\CONFIG.SYS"
  1539.  
  1540.                     In the  first usage  of the  SetVar command, the  variable
  1541.                        ErrCode  is set  to "99" and the  second usage sets the
  1542.                        variable FileName to "C:\CONFIG.SYS"
  1543.  
  1544.             UPPER      VarName1
  1545.             (101)
  1546.                  Change the alphabetic characters in VarName1 to upper case.
  1547.  
  1548.                  Ex:   Variable InString,25
  1549.                        WriteAt  14,25,"Enter your directory name "
  1550.                        ReadStr  InString    (user enters c:\util)
  1551.                        Upper    InString    (changed to C:\UTIL)
  1552.                        ?InPath  InString,GoodDir  (path is always upper case)
  1553.  
  1554.                     In this example,  the user is prompted  for a path name to
  1555.                        be  entered. The  path name  is to  be compared  to the
  1556.                        system  path for  validity. Since  the contents  of the
  1557.                        system path  are always  in upper case,  we change  the
  1558.                        InString variable to upper case prior to comparision.
  1559.  
  1560.             VARIABLE   VariableName, MaxLength [,InitialValue]
  1561.             (1)  Define  a variable  to PowerBatch.  All variables  used in  a
  1562.                     PowerBatch  program must have been defined with a VARIABLE
  1563.                     command. VariableName is  the name which  you give to this
  1564.                     variable  and the means by which you refer to the variable
  1565.                     in other PowerBatch  statements. This variable may contain
  1566.                     any  number of  characters up to  MaxLength and is  set to
  1567.                     the  initial value of  InitialValue. See the discussion on
  1568.                     variables at the beginning of this section.
  1569.                  Command line  parameters  passed  to  a  compiled  PowerBatch
  1570.                     program must  be defined  as variables. Up  to 16  command
  1571.                     line  variables  may be  passed to  a compiled  PowerBatch
  1572.                     program  and they  are defined  as CLP%1..CLP%16.  See the
  1573.                     example MOVE1 or MOVE2.
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.             Page 28                     PowerBatch                     Page 28
  1582.  
  1583.  
  1584.                  Ex:   Variable    DayOfWeek,9
  1585.                        Variable    ErrMsg1,25,"Invalid directory name."
  1586.                        Variable    InString,80,""
  1587.                        Variable    PauseTime,2,50
  1588.                        Variable    CLP%1,12       (command line parameter %1)
  1589.  
  1590.             WAIT       VarName1
  1591.             (119)      Literal1
  1592.                  Cause the  execution  of a  PowerBatch program  to pause  for
  1593.                     VarName1 tenths of a second(s).
  1594.  
  1595.                  Ex:   Wait        5           (pause half a second)
  1596.                        Wait        PauseTime   (pause 5 seconds)
  1597.  
  1598.             WRITE      VarName1, VarName2 [,VarName3]
  1599.             (58)       Literal1, Literal2 [,Literal3]
  1600.                  Write the string contained in VarName1 at the current  cursor
  1601.                     location using  color attributes  foreground VarName2  and
  1602.                     background  VarName3.  In  the  absence  of  VarName2  and
  1603.                     VarName3  use the current  color attributes. The string is
  1604.                     not  followed by a carriage return, line feed pair (ie the
  1605.                     cursor  is not  moved to  the first  position of  the next
  1606.                     line).
  1607.  
  1608.                  Ex:   Write    "Enter your password ",0,7
  1609.                        Variable ErrMsg1,25,"Invalid directory name."
  1610.                        Variable ErrClr,3,112
  1611.                        Write    ErrMsg1,ErrClr
  1612.  
  1613.             WRITEAT    VarName1, VarName2, VarName3 [,VarName4] [,VarName5]
  1614.             (46)       Literal1, Literal2, Literal3 [,Literal4] [,Literal5]
  1615.                  Write   the  string  contained  in  VarName3  at  column  (X)
  1616.                     contained  in VarName1  and row (Y)  contained in VarName2
  1617.                     using   the  foreground   color  attribute   contained  in
  1618.                     VarName4 and the  background color attribute contained  in
  1619.                     VarName5.  In the  absence of  VarName4 and  VarName5, use
  1620.                     the current color   attributes. The string is not followed
  1621.                     by  a carriage  return, line feed  pair (ie the  cursor is
  1622.                     not moved to the first position of the next line).
  1623.                  Ex:   Variable TitleClr,3,112
  1624.                        Variable CurrX,2
  1625.                        Variable CurrY,2
  1626.                        Variable CompName,25,"The ABC Company"
  1627.                        WriteAt  15,3,"The ABC Company",TitleClr
  1628.                        WriteAt  CurrX,CurrY,CompName
  1629.  
  1630.                     In the  first usage  of the  WriteAt  command the  literal
  1631.                        "The  ABC Company"  is written at column  15, row 3. In
  1632.                        the  second  usage,   the  contents  of  the   variable
  1633.                        CompName  ("The ABC Company")  is written at the column
  1634.                        location specified  by the contents  of variable  CurrX
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.             Page 29                     PowerBatch                     Page 29
  1643.  
  1644.                        and at  the row  location specified by the  contents of
  1645.                        variable CurrY.
  1646.  
  1647.             WRITELINE  VarName1 [,VarName2]
  1648.             (195)
  1649.                  Write  the string contained in VarName1 beginning in location
  1650.                     1 of the  line number  specified in  VarName2. Follow  the
  1651.                     string  with a carriage return line feed pair (ie move the
  1652.                     cursor  to the  first position of  the next line).  In the
  1653.                     absence  of  VarName2  write the  string  at  the  current
  1654.                     cursor location.
  1655.  
  1656.                  Ex:   WriteLine   "Please read these instructions ",7
  1657.                        WriteLine   Msg5
  1658.  
  1659.                     In the first usage of  WriteLine the message  "Please read
  1660.                        these  instructions " is  written beginning in column 1
  1661.                        of  row  7. In  the second  usage the  contents of  the
  1662.                        variable  Msg5  is  written beginning  at  the  current
  1663.                        cursor  location. In both cases a carriage return, line
  1664.                        feed  (position  cursor at  the first  position of  the
  1665.                        next line) is written.
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.             Page 30                     PowerBatch                     Page 30
  1674.  
  1675.                                      Command Summary
  1676.  
  1677.             ?COLOR        Var1, Var2, Var3 
  1678.             ?CURRDIR      Var1, Var2
  1679.             ?DATE         Var1, Var2, Var3, Var4
  1680.             ?DIREXIST     Var1, Lab1 [,Lab2]  or Lit1, Lab1 [,Lab2]
  1681.             ?DISKSPACE    Var1, Var2, Var3
  1682.             ?DRIVEEXIST   Var1, Lab1 [,Lab2] or Lit1, Lab1 [,Lab2]
  1683.             ?ENVSTR       Var1, Var2 or Lit1, Var2
  1684.             ?FILEEXIST    Var1, Lab1 [,Lab2] or Lit1, Lab1 [,Lab2]
  1685.             ?INPATH       Var1, Lab1 [,Lab2] or Lit1, Lab1 [,Lab2]
  1686.             ?TIME         Var1
  1687.             BEEP          Var1, Var2, Var3 or Lit1, Lit2, Lit3
  1688.             BLINK
  1689.             BOX1          Var1,  Var2, Var3,  Var4, Var5 [,V6]  or Lit1, Lit2,
  1690.                           Lit3, Lit4, Lit5, [,Lit6]
  1691.             BREAKON
  1692.             BREAKOFF
  1693.             CENTER        Var1, Var2 or Lit1, Lit2
  1694.             CLEAR         Var1 [,Var2] or Lit1 [,Lit2]
  1695.             CLEARBOX      Var1,  Var2, Var3,  Var4, Var5 [,V6]  or Lit1, Lit2,
  1696.                           Lit3, Lit4, Lit5 [,Lit6]
  1697.             CLEARLINE     Var1, Var2 [,Var3] or Lit1, Lit2, Lit3
  1698.             COLOR         Var1 [,Var2] or Lit1 [,Lit2]
  1699.             COMPARE       Var1,  Var2, Lab1  [,Lab2]  [,Lab3]  or Lit1,  Lit2,
  1700.                           Lab1 [,Lab2] [,Lab3]
  1701.             CONCAT        Var1, Var2 [,Var3] or Var1, Lit2 [,Lit3]
  1702.             GOTO          Lab1
  1703.             LENGTH        Var1, Var2 or Var1, Lit1
  1704.             LOWER         Var1 
  1705.             MIDSTRING     Var1, Var2, Var3, Var4 or Var1, Var2, Lit1, Lit2
  1706.             NORMAL
  1707.             PROMPT        Var1 or Lit1
  1708.             READKEY       Var1
  1709.             READSTR       Var1
  1710.             READUPKEY     Var1
  1711.             READYN        Var1, Var2 or Lit1, Var1
  1712.             REVERSE
  1713.             SETENV        Var1, Var2 or Lit1, Lit2
  1714.             SETPATH       Var1 or Lit1
  1715.             SETVAR        Var1, Var2 or Var1, Lit1
  1716.             UPPER         Var1
  1717.             VARIABLE      VariableName, MaxLength [,InitialValue]
  1718.             WAIT          Var1 or Lit1
  1719.             WRITE         Var1, Var2 [,Var3] or Lit1, Lit2 [,Lit2]
  1720.             WRITEAT       Var1,  Var2, Var3  [,Var4]  [,Var5]  or Lit1,  Lit2,
  1721.                           Lit3, [,Lit4] [,Lit5]
  1722.             WRITELINE     Var1 [,Var2] or Lit1 [,Lit2]
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.             Page 31                     PowerBatch                     Page 31
  1731.  
  1732.             ERRORLEVEL    Predefined  variable  containing the  value  of  the
  1733.                           exit code set by the previous program or command.
  1734.  
  1735.             DOSERROR      Predefined variable  containing the  last set  value
  1736.                           of the operating system error code.
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.             Page 32                     PowerBatch                     Page 32
  1745.  
  1746.                                     Compilation Errors
  1747.  
  1748.             Compilation  errors are printed on  the screen and also written in
  1749.             a  file named  POWERBAT.ERR (If  you have  a split  screen editor,
  1750.             view  the source  in one screen part  and the errors  in the other
  1751.             part).  If  the  source line  is  available,  the source  line  is
  1752.             printed  above the error preceded by the line number count. Source
  1753.             lines  are not  available during the  second pass of  the compiler
  1754.             which may generate "Label not defined" and "Variable not  defined"
  1755.             errors.
  1756.  
  1757.               "Not a valid command" -  This error is generated  when the first
  1758.                  word  on the  command line  is not  a PowerBatch  command and
  1759.                  contains more than 8 characters.
  1760.  
  1761.                  Example:
  1762.                     13 Directory name checked here.
  1763.                     [DIRECTORY] Not a valid command
  1764.  
  1765.                     Probably should be ;Directory name checked here
  1766.  
  1767.               "Missing variable" -  A command contains less than the  required
  1768.                  number of operands.
  1769.  
  1770.                  Example:
  1771.                     21 ?Color   ForeColor,BackColor
  1772.                     [] Missing variable
  1773.  
  1774.                     Variable for the composite color byte is missing.
  1775.  
  1776.               "Expected a variable  Name" - A string  was found in an  operand
  1777.                  that may contain only a variable name.
  1778.  
  1779.                  Example:
  1780.                     10 ?Time "Current Time"
  1781.                     [Current Time] Expected a variable name
  1782.  
  1783.                     The current time may only be placed in a variable.
  1784.  
  1785.               "Quoted   literal  not   terminated"  -   A  single   quote  was
  1786.                  encountered within a source line.
  1787.  
  1788.                  Example:
  1789.                     9 Center "Move Command,5
  1790.                     [] Quoted literal not terminated
  1791.  
  1792.                     Closing quote should precede comma.
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.             Page 33                     PowerBatch                     Page 33
  1801.  
  1802.               "Invalid  max  length  specified"  -  The second  operand  of  a
  1803.                  variable  definition should specify the maximum length of the
  1804.                  variable. The value found was not numeric.
  1805.  
  1806.                  Example:
  1807.                     3 Variable  CompName,"The ABC Company"
  1808.                     [The ABC Company] Invalid max length specified
  1809.  
  1810.               "Variable not defined" -  A reference to a variable was made  in
  1811.                  the  source file  but the variable  was not defined  with the
  1812.                  Variable command.
  1813.  
  1814.                  Example:
  1815.                     [CURRDATE] Variable not defined
  1816.  
  1817.               "Duplicate  variable" - The same variable name has appeared 2 or
  1818.                  more times in a Variable definition statement.
  1819.  
  1820.                  Example:
  1821.                     7 Variable  CompName,25
  1822.                     [COMPNAME] Duplicate variable
  1823.  
  1824.               "Duplicate label" - The same  label name has appeared  2 or more
  1825.                  times in a Label definition statement.
  1826.  
  1827.                  Example:
  1828.                     16 Label    Step2
  1829.                     [STEP2] Duplicate label
  1830.  
  1831.               "External command >" - This  is not an error  message, but is  a
  1832.                  check  to alert  you to  each command  found in  a PowerBatch
  1833.                  source  file  that will  be treated  as an  external command.
  1834.                  External  commands are DOS intrinsic commands, .COM, and .EXE
  1835.                  commands or programs (even PowerBatch  compiled programs) and
  1836.                  .BAT  (standard DOS  batch files) that are  to be executed by
  1837.                  PowerBatch.
  1838.  
  1839.                  Example:
  1840.                     External command > 12 DIR     (DOS directory command)
  1841.                     External command > 29 MYPROG  (Executable module MYPROG)
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.             Page 34                     PowerBatch                     Page 34
  1850.  
  1851.                            Removing PowerBatch From Your System
  1852.  
  1853.             While  we  believe  that  PowerBatch  is  a  batch  compiler  that
  1854.             everyone should own, we recognize that there are some who feel  it
  1855.             is not a  program they will use on  a regular basis. For those  of
  1856.             you in that minority,  we have provided a program to easily remove
  1857.             all PowerBatch modules  from your  system. To  remove all  modules
  1858.             from  your system  that were  supplied on  the  PowerBatch install
  1859.             disk, enter
  1860.  
  1861.               DELETEPB <enter>
  1862.  
  1863.             You  will be asked  if you wish  to remove  all PowerBatch modules
  1864.             from  the  currently logged  disk. If  this is  the correct  disk,
  1865.             enter Y. If it is  not the correct disk, enter  N and the  program
  1866.             will  terminate. (You  should  move  to  the disk  containing  the
  1867.             PowerBatch  modules.)  You  will next  be  asked  if you  wish  to
  1868.             confirm  each deletion. If you reply (Y)es, each time a PowerBatch
  1869.             module is found,  you will  be asked  if you  wish to delete  this
  1870.             module. If  you reply (N)o,  the modules will  be deleted as  they
  1871.             are found without your intervention.
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.             Page 35                     PowerBatch                     Page 35
  1880.  
  1881.                                          Examples
  1882.  
  1883.             The source for  these examples is  contained on  your installation
  1884.             disk. These examples may be compiled using the POWERMAK command.
  1885.  
  1886.             Example:      POWERMAK DEMO1 <enter>
  1887.  
  1888.                                           DEMO1
  1889.  
  1890.             This  listing  for  DEMO1  contains  line  numbers  preceding  the
  1891.             PowerBatch  command. These line numbers are for reference purposes
  1892.             within the  documentation and  are not  contained  in the  source.
  1893.             Line numbers are in fact not allowed in any PowerBat source file.
  1894.  
  1895.                1     Variable          Fore,1           ;save area for initial
  1896.             colors
  1897.                2    Variable        Back,1
  1898.                3    Variable        ColorAttr,1
  1899.                4    Variable        CharIn,1      ;for user responses
  1900.                5    Variable        RedOnGray,3,116
  1901.                6    Variable        RedOnBlack,3,4
  1902.                7    Variable        YelOnBlue,3,30
  1903.                8    Variable        YelOnGray,3,126
  1904.                9    Variable        BlueOnGray,3,113
  1905.               10    Variable        DOW,9                ;for date command
  1906.               11    Variable        Mo,2
  1907.               12    Variable        Da,2
  1908.               13    Variable        Yr,4
  1909.               14    Variable        CurrTime,11   ;for current time
  1910.               15    Variable        DirName,78    ;for user entered dir name
  1911.               16    Variable        FileName,78   ;for user entered file name
  1912.               17    Variable         Space35,35,"                             
  1913.                 "
  1914.               18    Variable        Space76,76,"                              
  1915.                                                          "
  1916.               19    Variable        TotSpace,10
  1917.               20    Variable        AvailSpace,10
  1918.               21    Variable        Msg,78
  1919.               22    Variable        Msg2,78
  1920.               23    Variable        FName,35
  1921.               24    Variable        LName,35
  1922.               25    ?Color          Fore,Back,ColorAttr  ;initial color
  1923.               26    ?Date           DOW,Mo,Da,Yr         ;get system date
  1924.               27    ?Time           CurrTime             ;get system time
  1925.               28    Clear
  1926.               29      ReadYN             "Do  you have a  color monitor? [Y/N]
  1927.             ",CharIn
  1928.               30    Compare         CharIn,"Y",,,ColorMon
  1929.               31    SetVar          RedOnGray,112
  1930.               32    SetVar          YelOnBlue,7
  1931.               33    SetVar          BlueOnGray,7
  1932.               34    Label           ColorMon
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.             Page 36                     PowerBatch                     Page 36
  1941.  
  1942.               35    Clear           BlueOnGray           ;clear to my color
  1943.               36    Box1            2,10,79,25,YelOnGray ;info box border
  1944.               37    ClearBox        2,10,79,25,YelOnBlue ;     interior
  1945.               38    Color           RedOnGray
  1946.               39    Box1            24,1,56,5,RedOnGray  ;title box
  1947.               40    ClearBox        24,1,56,5,RedOnBlack
  1948.               41    Color           RedOnBlack
  1949.               42    Center          "POWERBATCH",2
  1950.               43    Center          "By",3
  1951.               44    Center          "Computing Systems Design, Inc.",4
  1952.               45    Color           YelOnBlue
  1953.               46    WriteAt         3,11,"PowerBatch is  a power batch utility
  1954.             that produces COMPILED batch files."
  1955.               47     WriteAt         3,12,"With PowerBatch you can perform all
  1956.             standard DOS batch functions, plus"
  1957.               48     WriteAt           3,13,"use the  35 additional PowerBatch
  1958.             commands to create batch files with POWER."
  1959.               49      WriteAt            3,15,"PowerBatch compiles  your batch
  1960.             commands and produces a standalone .EXE"
  1961.               50     WriteAt            3,16,"module that  executes at the top
  1962.             speed of your computer. This information"
  1963.               51    WriteAt           3,17,"and demonstration program  you are
  1964.             now running is a compiled PowerBatch"
  1965.               52     WriteAt           3,18,"program  (the included  source is
  1966.             DEMO1.PWR). PowerBatch is especially"
  1967.               53       WriteAt             3,19,"powerful  for screen  related
  1968.             functions. Draw boxes, write to the screen with"
  1969.               54     WriteAt         3,20,"blazing speed,  control text colors
  1970.             with ease, get input from the user, make"
  1971.               55       WriteAt             3,21,"data  comparisions and  logic
  1972.             branches, and access system information with"
  1973.               56     WriteAt          3,22,"single commands. Follow this  tour
  1974.             of the power in PowerBatch."
  1975.               57    GoToXY          26,24
  1976.               58    Write           "Press any key to continue...",RedOnGray
  1977.               59    ReadKey         CharIn
  1978.               60    ClearBox        2,10,79,25,YelOnBlue
  1979.               61     WriteAt          3,11,"PowerBatch gives you access to the
  1980.             system date and time and makes these"
  1981.               62    WriteAt         3,12,"available as variables for your  use
  1982.             in screen writes."
  1983.               63     WriteAt         3,14,"The system date is returned in four
  1984.             variables of your choice. In these"
  1985.               64    GoToXY          3,15
  1986.               65    Write           "variables are placed Day of the week ("
  1987.               66    Write           DOW
  1988.               67    Write           ") Month number ("
  1989.               68    Write           Mo
  1990.               69    Write           "),"
  1991.               70    GoToXY          3,16
  1992.               71    Write           "Day number ("
  1993.               72    Write           Da
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.             Page 37                     PowerBatch                     Page 37
  2002.  
  2003.               73    Write           "), and Year number ("
  2004.               74    Write           Yr
  2005.               75    Write           ")."
  2006.               76     WriteAt          3,18,"In a  like manner the current time
  2007.             may be retrieved into a variable of your"
  2008.               77    WriteAt         3,19,"choice, and used any way you wish."
  2009.               78    WriteAt         3,21,"Current time is "
  2010.               79    WriteAt         19,21,CurrTime
  2011.               80    GoToXY          26,24
  2012.               81    Color           YelOnBlue
  2013.               82    Blink
  2014.               83    Write           "Press any key to continue..."
  2015.               84    Normal
  2016.               85    ReadKey         CharIn
  2017.               86    ClearBox        2,10,79,25,YelOnBlue
  2018.               87    WriteAt           3,11,"PowerBatch also provides  you with
  2019.             several input commands to retrieve both"
  2020.               88     WriteAt           3,12,"data and question responses  from
  2021.             the user. Commands are provided to retrieve"
  2022.               89     WriteAt           3,13,"one  key (and one key only), read
  2023.             one key in upper case, read either Y or N"
  2024.               90    WriteAt          3,14,"for Yes/No responses, and to read a
  2025.             string of a specified length."
  2026.               91    GoToXY          3,15
  2027.               92    Write           "Enter one character in lower case [ ]"
  2028.               93    GoToXY          38,15
  2029.               94    ReadKey         CharIn
  2030.               95    GoToXY          41,15
  2031.               96    Write           "You can manipulate the case "
  2032.               97    GoToXY          3,16
  2033.               98    Write            "of the data entered changing from  lower
  2034.             ["
  2035.               99    Write           CharIn
  2036.              100    Write           "] to upper ["
  2037.              101    Upper           CharIn
  2038.              102    Write           CharIn
  2039.              103    Write           "] to lower ["
  2040.              104    Lower           CharIn
  2041.              105    Write           CharIn
  2042.              106    Write           "]."
  2043.              107     WriteAt            3,18,"PowerBatch also  contains strong
  2044.             string manipulation commands."
  2045.              108    WriteAt         3,19,"Enter your last name "
  2046.              109    ReadStr         LName
  2047.              110    WriteAt         14,19,Space35
  2048.              111    WriteAt         14,19,"first name "
  2049.              112    ReadStr         FName
  2050.              113    WriteAt         3,19,Space35
  2051.              114    Midstring       Msg,FName,1,3
  2052.              115    Midstring       Msg2,LName,1,3
  2053.              116    Concat          Msg," "
  2054.              117    Concat          Msg,Msg2
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.             Page 38                     PowerBatch                     Page 38
  2063.  
  2064.              118    WriteAt         3,20,Msg
  2065.              119    Wait            10
  2066.              120    Midstring       Msg,FName,1,6
  2067.              121    Midstring       Msg2,LName,1,6
  2068.              122    Concat          Msg," "
  2069.              123    Concat          Msg,Msg2
  2070.              124    WriteAt         3,20,Msg
  2071.              125    Wait            10
  2072.              126    Concat          Msg,FName," "
  2073.              127    Concat          Msg,LName
  2074.              128    WriteAt         3,20,Msg
  2075.              129    Length          Msg2,Msg
  2076.              130      Concat            Msg,"The length of  this name field is
  2077.             ",Msg2
  2078.              131    WriteAt         3,21,Msg
  2079.              132    GoToXY          26,24
  2080.              133    Write           "Press any key to continue...",RedOnGray
  2081.              134    ReadKey         CharIn
  2082.              135    ClearBox        2,10,79,25,YelOnBlue
  2083.              136    WriteAt          3,11,"PowerBatch gives you the capability
  2084.             to verify drives, directories, or file"
  2085.              137    WriteAt          3,12,"names entered by the user. You  may
  2086.             execute selected portions of the batch"
  2087.              138     WriteAt            3,13,"file based  on the existance  or
  2088.             non-existance of these entries."
  2089.              139    Label           ChekDrive
  2090.              140    GoToXY          3,15
  2091.              141    Write           "Enter a drive letter to be verified"
  2092.              142    Write           Space35
  2093.              143    GoToXY          39,15
  2094.              144    ReadUpKey       CharIn
  2095.              145    ?DriveExist     CharIn,GoodDrive
  2096.              146    Blink
  2097.              147     WriteAt           3,24,"That is not a valid drive in your
  2098.             system. Please re-enter."
  2099.              148    Normal
  2100.              149    Beep            750,8
  2101.              150    Wait            30
  2102.              151    WriteAt         3,24,Space76
  2103.              152    GoTo            ChekDrive
  2104.              153    Label           GoodDrive
  2105.              154    GoToXY          3,16
  2106.              155    Write           "Enter a directory name to be verified"
  2107.              156    Write           Space35
  2108.              157    GoToXY          41,16
  2109.              158    ReadStr         DirName
  2110.              159    ?DirExist       DirName,GoodDir
  2111.              160    Blink
  2112.              161    WriteAt           3,24,"That is not  a valid directory  in
  2113.             your system. Please re-enter."
  2114.              162    Normal
  2115.              163    Wait            30
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.             Page 39                     PowerBatch                     Page 39
  2124.  
  2125.              164    WriteAt         3,24,Space76
  2126.              165    GoTo            GoodDrive
  2127.              166    Label           GoodDir
  2128.              167    GoToXY          3,17
  2129.              168    Write           "Enter a file name to be verified"
  2130.              169    Write           Space35
  2131.              170    GoToXY          36,17
  2132.              171    ReadStr         FileName
  2133.              172    ?FileExist      FileName,GoodFile
  2134.              173    Blink
  2135.              174     WriteAt           3,24,"That is not  a valid filename  in
  2136.             your system. Please re-enter."
  2137.              175    Normal
  2138.              176    Wait            30
  2139.              177    WriteAt         3,24,Space76
  2140.              178    GoTo            GoodDir
  2141.              179    Label           GoodFile
  2142.              180    WriteAt          3,18,"PowerBatch can  query your disk for
  2143.             total space and available space"
  2144.              181     WriteAt            3,19,"Drive [  ] capacities are (enter
  2145.             drive letter)"
  2146.              182    GoToXy          10,19
  2147.              183    ReadUpKey       CharIn
  2148.              184    ?DiskSpace      CharIn,TotSpace,AvailSpace
  2149.              185    Concat          Msg,CharIn," has "
  2150.              186    Concat          Msg,AvailSpace
  2151.              187    Concat          Msg," bytes available of the total "
  2152.              188    Concat          Msg,TotSpace
  2153.              189    Concat          Msg," bytes"
  2154.              190    WriteAt         9,19,Msg
  2155.              191    GoToXY          26,24
  2156.              192    Write           "Press any key to continue...",RedOnGray
  2157.              193    ReadKey         CharIn
  2158.              194    Clear
  2159.              195     WriteLine       "PowerBatch can run any valid DOS command
  2160.             that may be inserted in a batch file."
  2161.              196     WriteLine        "For example, here is  a listing of your
  2162.             current directory..."
  2163.              197    Wait            30
  2164.              198    Clear           ColorAttr     ;clear to default color
  2165.              199    Dir             "/w"
  2166.              200    Wait            30
  2167.              201    Color           YelOnBlue
  2168.              202    Clear
  2169.              203     WriteLine          "PowerBatch can also run  (and return)
  2170.             other PowerBatch programs, giving you a "
  2171.              204       WriteLine          "subroutine  capability. It  has the
  2172.             capability to re-boot the system (which I"
  2173.              205    WriteLine       "will NOT demonstrate here."
  2174.              206    GoToXY          1,5
  2175.              207    WriteLine        "The purpose of  this demonstration is to
  2176.             not only show you the capabilities"
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.             Page 40                     PowerBatch                     Page 40
  2185.  
  2186.              208     WriteLine        "of  PowerBatch, but to let you  compare
  2187.             the source with the running version"
  2188.              209      WriteLine         "of this  program and  aid you  in the
  2189.             development of your own PowerBatch"
  2190.              210    WriteLine       "programs."
  2191.              211    GoToXY          1,10
  2192.              212    Write           "Press any key to continue..."
  2193.              213    ReadKey         CharIn
  2194.              214    Color           ColorAttr     ;reset original colors
  2195.              215    Clear
  2196.              216    Box1            24,1,56,5,ColorAttr
  2197.              217    Center          "POWERBATCH",2
  2198.              218    Center          "By",3
  2199.              219    Center          "Computing Systems Design, Inc.",4
  2200.              220    GoToXy          1,24
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.             Page 41                     PowerBatch                     Page 41
  2209.  
  2210.                                           MOVE1
  2211.  
  2212.             Variable        CLP%1,79,"a"          ;command line parm %1
  2213.             Variable        CLP%2,79,"a"          ;%2
  2214.             Variable        InChar,1              ;for keyboard responses
  2215.             Compare         CLP%1,"a",,,Syntax    ;show syntax
  2216.             Compare         CLP%2,"a",,,Syntax
  2217.             Clear                                 ;clear the screen
  2218.             Upper           CLP%1                 ;make CLP%1 upper case
  2219.             Upper           CLP%2                 ;make CLP%2 upper case
  2220.             Write           "Move "               ;build initial msg
  2221.             Write           CLP%1
  2222.             Write           " to "
  2223.             WriteLine       CLP%2
  2224.             ?FileExist      CLP%1,File1OK         ;does source file exist
  2225.             Write           CLP%1                 ;write error msg
  2226.             WriteLine       " not found."
  2227.             GoTo            BadCopy
  2228.             Label           File1OK
  2229.             ?FileExist         CLP%2,,File2OK          ;does  destination file
  2230.             exist
  2231.             Write           CLP%2                 ;write error msg
  2232.             WriteLine       " exists!"
  2233.             ReadYN          "Overwrite? [Y/N] ",InChar
  2234.             WriteLine       ""
  2235.             Compare         InChar,"N",,,BadCopy
  2236.             Label           File2OK
  2237.             Compare         CLP%1,CLP%2,,,DupFiles ;cannot copy to itself
  2238.             Copy            CLP%1 CLP%2            ;DOS copy command
  2239.             ?FileExist       CLP%2,,BadCopy          ;did  output file make it
  2240.             OK
  2241.             Write           "Erasing "             ;tell user erasing source
  2242.             WriteLine       CLP%1
  2243.             Erase           CLP%1                  ;DOS erase command
  2244.             WriteLine       "Move successful"      ;msg to user
  2245.             Halt
  2246.             Label           DupFiles
  2247.             WriteLine       "Cannot move a file to itself"
  2248.             Label            BadCopy                   ;unsuccessful comes  to
  2249.             here
  2250.             WriteLine       "Move unsuccessful"
  2251.             Halt
  2252.             Label           Syntax
  2253.             WriteLine       "Syntax is Move1 SourceFileName TargetFileName"
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.             Page 42                     PowerBatch                     Page 42
  2262.  
  2263.                                           MOVE2
  2264.  
  2265.             Variable        CLP%1,79,"a"           ;command line parm %1
  2266.             Variable        CLP%2,79,"a"           ;%2
  2267.             Variable        InChar,1               ;for keyboard responses
  2268.             Compare         CLP%1,"a",,,Syntax     ;show syntax
  2269.             Compare         CLP%2,"a",,,Syntax
  2270.             Clear                                  ;clear the screen
  2271.             Upper           CLP%1                  ;make CLP%1 upper case
  2272.             Upper           CLP%2                  ;make CLP%2 upper case
  2273.             Write           "Move "                ;build initial msg
  2274.             Write           CLP%1
  2275.             Write           " to "
  2276.             WriteLine       CLP%2
  2277.             Label           ChkFile1
  2278.             ?FileExist      CLP%1,File1OK          ;does source file exist
  2279.             Blink                                     ;if not make screen text
  2280.             blink
  2281.             Write           CLP%1                  ;write error msg
  2282.             WriteLine       " not found."
  2283.             Normal                                 ;set text to normal
  2284.             Write           "Enter source file name : " ;prompt user for name
  2285.             ReadStr         CLP%1
  2286.             GoTo            ChkFile1
  2287.             Label           File1OK                ;check new name for exists
  2288.             ?FileExist        CLP%2,,File2OK           ;does  destination file
  2289.             exist
  2290.             Blink                                  ;if not then text to blink
  2291.             Write           CLP%2                  ;write error message
  2292.             WriteLine       " exists!"
  2293.             Normal                                 ;set text to normal
  2294.             ReadYN          "Overwrite? [Y/N] ",InChar      ;query user
  2295.             WriteLine       ""
  2296.             Compare         InChar,"N",,,BadCopy   ;if user entered "Y"  exit
  2297.             Label           File2OK                ;come here if all OK
  2298.             Compare         CLP%1,CLP%2,,,DupFiles ;cannot copy to itself
  2299.             Copy            CLP%1 CLP%2            ;DOS copy command
  2300.             ?FileExist      CLP%2,,BadCopy         ;is output file OK
  2301.             Reverse                                ;make text reverse video
  2302.             Write           "Erasing "             ;write erase message
  2303.             WriteLine       CLP%1
  2304.             Normal                                 ;set text back to normal
  2305.             Erase           CLP%1                  ;DOS erase command
  2306.             WriteLine       "Move successful"      ;tell user all is OK
  2307.             Halt
  2308.             Label           DupFiles
  2309.             WriteLine       "Cannot move a file to itself"
  2310.             Label           BadCopy
  2311.             WriteLine       "Move unsuccessful"
  2312.             Label           Syntax
  2313.             WriteLine       "Syntax is Move1 SourceFileName TargetFileName"
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.             Page 43                     PowerBatch                     Page 43
  2322.  
  2323.                                           MENU1
  2324.  
  2325.             Variable        FColor,1                 ;store the current screen
  2326.             colors
  2327.             Variable      BColor,1
  2328.             Variable      ColorAttr,1
  2329.             Variable      MenuSel,1
  2330.             ?Color        FColor,BColor,ColorAttr
  2331.             Label         ShowMenu
  2332.             Clear         112                  ;clear screen to a new color
  2333.             Center        "Demonstration Menu",2    ;center on line 2
  2334.             WriteAt       10,4,"A. Run a directory and return"
  2335.             WriteAt           10,6,"B.  Run BoxDemo  and return  (DOS batch  +
  2336.             PowerBatch + return)"
  2337.             WriteAt       10,8,"C. Reboot your system"
  2338.             WriteAt       10,10,"E. Exit this menu and return to DOS"
  2339.             Label         GetInp
  2340.             WriteAt       15,13,"Enter your choice :"
  2341.             GoToXY        34,13
  2342.             ReadUpKey     MenuSel                   ;get users selection
  2343.             Compare       MenuSel,"A",ChekB,Error   ;compare selection to A
  2344.             Clear          7,0                   ;clear screen to fore 7, back
  2345.             0
  2346.             dir           "/w"                 ;run DOS dir cmd with /w parm
  2347.             Wait          30                        ;wait 3 secs for show
  2348.             GoTo          ShowMenu                  ;redisplay menu
  2349.             Label         ChekB
  2350.             Compare       MenuSel,"B",ChekC,Error   ;compare selection to B
  2351.             Clear         15                   ;clear screen to attribute 15
  2352.             DOSEX1                                  ;run a DOS  batch file   &
  2353.             PowerBatch program
  2354.             Wait          30                   ;wait 3 secs
  2355.             GoTo          ShowMenu             ;redisplay menu
  2356.             Label         ChekC
  2357.             Compare       MenuSel,"C",ChekE,Error   ;compare selection to C
  2358.             Boot                                    ;perform a warm boot
  2359.             Label         ChekE
  2360.             Compare       MenuSel,"E",Error,Error   ;compare selection to E
  2361.             Clear         ColorAttr                 ;restore original color
  2362.             Halt                                           ;end the PowerBatch
  2363.             program
  2364.             Label         Error                     ;come here for errors
  2365.             Blink                                   ;reverse the colors
  2366.             WriteAt       5,20,"InCorrect menu selection...Try again."
  2367.             Beep          750,5                ;beep at 750 hz for half sec
  2368.             Wait          30                        ;wait 3 secs to see msg
  2369.             Normal                                  ;restore text attributes
  2370.             ClearLine     20                        ;clear the message line
  2371.             GoToXY        34,13                     ;erase the wrong entry
  2372.             Write         " "
  2373.             GoTo          GetInp                    ;get new menu selection
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.             Page 44                     PowerBatch                     Page 44
  2382.  
  2383.                                          BOXDEMO2
  2384.  
  2385.             Variable    FColor,1
  2386.             Variable    BColor,1
  2387.             Variable    ColorAttr,1
  2388.             Variable    Clr1,3,30
  2389.             Variable    Clr2,3,46
  2390.             Variable    Clr3,3,62
  2391.             Variable    Clr4,3,78
  2392.             Variable    Clr5,3,94
  2393.             Variable    Clr6,3,110
  2394.             Variable    InChar,1
  2395.             ?Color      FColor,BColor,ColorAttr           ;save curr colors
  2396.             Clear       Clr1                         ;clear screen to color 1
  2397.             Label       MonType
  2398.             GoToXY      1,20
  2399.             ReadYN      "Do you have a color monitor? [Y/N] ",InChar
  2400.             Compare     InChar,"N",ColorsOK
  2401.             SetVar      Clr1,7                       ;reset colors for mono
  2402.             SetVar      Clr2,112
  2403.             SetVar      Clr3,112
  2404.             SetVar      Clr4,112
  2405.             SetVar      Clr5,112
  2406.             SetVar      Clr6,112
  2407.             Label       ColorsOK
  2408.             Clear       Clr1                              ;clear screen
  2409.             Box1         15,7,66,18,Clr1               ;draw center box, color
  2410.             1
  2411.             WriteAt         16,8,"Drawing  boxes  (or  frames)  around  screen
  2412.             displays"
  2413.             WriteAt         17,9,"seems  to add  a  finishing touch  to menus,
  2414.             messages"
  2415.             WriteAt        17,10,"or  any other  information  conveyed to  the
  2416.             user."
  2417.             WriteAt        16,12,"With  a  batch file,  not  only is  it  time
  2418.             consuming,"
  2419.             WriteAt         17,13,"but  painfully slow.  Most  of the  time it
  2420.             simply"
  2421.             WriteAt     17,14,"is not worth the trouble."
  2422.             WriteAt     16,16,"With PowerBatch, you draw your frame with one"
  2423.             WriteAt     17,17,"command. And it is a little faster..."
  2424.             Box1        2,1,14,6,Clr1                ;draw boxes around perif
  2425.             Box1        2,7,14,12,Clr1
  2426.             Box1        2,13,14,18,Clr1
  2427.             Box1        2,19,14,24,Clr1
  2428.             Box1        15,19,27,24,Clr1
  2429.             Box1        28,19,40,24,Clr1
  2430.             Box1        41,19,53,24,Clr1
  2431.             Box1        54,19,66,24,Clr1
  2432.             Box1        67,19,79,24,Clr1
  2433.             Box1        67,13,79,18,Clr1
  2434.             Box1        67,7,79,12,Clr1
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.             Page 45                     PowerBatch                     Page 45
  2443.  
  2444.             Box1        67,1,79,6,Clr1
  2445.             Box1        54,1,66,6,Clr1
  2446.             Box1        41,1,53,6,Clr1
  2447.             Box1        28,1,40,6,Clr1
  2448.             Box1        15,1,27,6,Clr1
  2449.             wait        30                                  ;wait 3 secs
  2450.             ClearBox    2,1,14,6,Clr6             ;clear boxes to diff colors
  2451.             ClearBox    2,7,14,12,Clr2
  2452.             ClearBox    2,13,14,18,Clr3
  2453.             ClearBox    2,19,14,24,Clr4
  2454.             ClearBox    15,19,27,24,Clr5
  2455.             ClearBox    28,19,40,24,Clr6
  2456.             ClearBox    41,19,53,24,Clr2
  2457.             ClearBox    54,19,66,24,Clr3
  2458.             ClearBox    67,19,79,24,Clr4
  2459.             ClearBox    67,13,79,18,Clr5
  2460.             ClearBox    67,7,79,12,Clr6
  2461.             ClearBox    67,1,79,6,Clr2
  2462.             ClearBox    54,1,66,6,Clr3
  2463.             ClearBox    41,1,53,6,Clr4
  2464.             ClearBox    28,1,40,6,Clr5
  2465.             ClearBox    15,1,27,6,Clr6
  2466.             Wait        30
  2467.             ClearBox    28,19,40,24,Clr1
  2468.             ClearBox    28,1,40,6,Clr1
  2469.             ClearBox    2,19,14,24,Clr1
  2470.             ClearBox    54,1,66,6,Clr1
  2471.             ClearBox    67,1,79,6,Clr1
  2472.             ClearBox    67,7,79,12,Clr1
  2473.             ClearBox    67,13,79,18,Clr1
  2474.             ClearBox    67,19,79,24,Clr1
  2475.             ClearBox    54,19,66,24,Clr1
  2476.             ClearBox    15,19,27,24,Clr1
  2477.             ClearBox    15,1,27,6,Clr1
  2478.             ClearBox    2,13,14,18,Clr1
  2479.             ClearBox    2,7,14,12,Clr1
  2480.             ClearBox    41,1,53,6,Clr1
  2481.             ClearBox    41,19,53,24,Clr1
  2482.             ClearBox     2,1,14,6,Clr1                   ;clear boxes  to diff
  2483.             colors
  2484.             WriteAt     1,25,"Press any key to exit"
  2485.             GoToXY      23,25                      ;position cursor after msg
  2486.             ReadKey      InChar                        ;wait for user to press
  2487.             key
  2488.             Clear         ColorAttr                      ;clear screen to orig
  2489.             color
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.             Page 46                     PowerBatch                     Page 46
  2498.  
  2499.                                           Index
  2500.  
  2501.      ASP  1                                    ?INPATH  18
  2502.      Box  19                                   ?TIME  18
  2503.      Case                                      BEEP  19
  2504.            lower  24                           BLINK  19
  2505.            upper  26, 27                       BOX  19
  2506.      Color attribute  15, 25                   BREAKOFF  20
  2507.      Command line parameters  27               BREAKON  20
  2508.      Command Summary  30                       CENTER  20
  2509.      Command Syntax  15                        CLEAR  20
  2510.      Comments  10                              CLEARBOX  21
  2511.      Compare                                   CLEARLINE  21
  2512.            alphabetic  22                      COLOR  21
  2513.            numeric  22                         COMPARE  22
  2514.      Compilation Errors  32                    CONCAT  23
  2515.      Concatenate  23                           GOTO  23
  2516.      Concept Of Operation  5                   GOTOXY  23
  2517.      Copyright  1                              HALT  24
  2518.      Ctrl - Break  20                          LABEL  24
  2519.      Current date  16                          LENGTH  24
  2520.      Current time  18                          LOWER  24
  2521.      Cursor  23                                MIDSTRING  24
  2522.      Directory  17                             NORMAL  25
  2523.      Disk capacity  17                         PROMPT  25
  2524.      Disk free space  17                       READKEY  25
  2525.      DOS errorlevel  24                        READSTR  25
  2526.      DOS search path  18                       READUPKEY  26
  2527.      DOSERROR  11, 13                          READYN  26
  2528.      Environment variable  18                  REVERSE  26
  2529.      ERRORLEVEL  11, 13, 24                    SETENV  26
  2530.      External command  13, 33                  SETPATH  27
  2531.      Field length                              SETVAR  27
  2532.            maximum  25, 27                     UPPER  27
  2533.      File exists  18                           VARIABLE  27
  2534.      Frame  19                                 WAIT  28
  2535.      Installation  7                           WRITE  28
  2536.      Interior of a box  21                     WRITEAT  28
  2537.      Introduction  1                           WRITELINE  29
  2538.      Line numbers  35                       POWERMAK  9
  2539.      Literals  10, 11                       Registration  1
  2540.      Pause  28                              Registration Fees  3
  2541.      POWERBAT.ERR  32                       Removing PowerBatch From Your
  2542.      PowerBatch Commands  10                      System  34
  2543.            ?COLOR  15                       Screen clear  20
  2544.            ?CURRDIR  15                     Shareware  1
  2545.            ?DATE  15                        Software Support  4
  2546.            ?DIREXIST  16                    String length  24
  2547.            ?DISKSPACE  17                   Substring  24
  2548.            ?DRIVEEXIST  17                  System speaker  19
  2549.            ?ENVSTR  18                      Valid drive  17
  2550.            ?FILEEXIST  18                   Value
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.             Page 47                     PowerBatch                     Page 47
  2559.  
  2560.            initial  27
  2561.      Variable  10
  2562.            value  27
  2563.      Variable map  9
  2564.      Warranty  2
  2565.      What You Get  3
  2566.